我無法運行我的應用程式并且某些屬性無法識別,因為應用程式構建結果建議不支持資源.我如何修復所有資源值?它可能是依賴項中的問題嗎? android作業室可以讀取依賴和資源分配.它是如何相關的 到android資源的不兼容性問題這是我的xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
app:contentInsetLeft="0dp"
app:contentInsetStart="16dp"
android:background="@color/colorPrimary"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolBar"
android:id="@+id/add_reminder_layout_top"
android:orientation="vertical"
>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/reminder_title"
android:layout_marginLeft="32dp"
android:layout_marginTop="10dp"
android:hint="Name"
android:textSize="20sp"
android:minLines="1"
android:background="@android:color/transparent"
android:drawableLeft="@drawable/ic_person_black_24dp"
android:drawablePadding="12dp"
android:gravity="center|start"
android:textColor="@android:color/background_dark"
android:scrollHorizontally="false"
android:textColorHint="@android:color/background_dark"
android:inputType="textCapWords"
android:layout_marginRight="16dp"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/phone_no"
android:layout_marginLeft="32dp"
android:hint="phone Number"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp"
android:textSize="20sp"
android:background="@android:color/transparent"
android:drawableLeft="@drawable/ic_phone_black_24dp"
android:drawablePadding="12dp"
android:gravity="center|start"
android:textColor="@android:color/background_dark"
android:scrollHorizontally="false"
android:textColorHint="@android:color/background_dark"
android:inputType="phone"
android:layout_marginRight="16dp"
/>
</LinearLayout>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/add_reminder_layout_top">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_marginTop="8dp"
android:text="@string/details"
android:id="@+id/details"
android:textSize="15sp"
android:gravity="center_vertical"
android:layout_marginLeft="72dp"
android:textColor="@android:color/primary_text_light"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
android:onClick="setDate"
android:id="@+id/date"
android:background="@drawable/ic_launcher_foreground"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/date_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="https://bbs.csdn.net/topics/@drawable/ic_date"
android:layout_centerVertical="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/date_icon">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/date_text"
android:textSize="15dp"
android:text="@string/date"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set_date"
android:textSize="15dp"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
android:onClick="setTime"
android:id="@+id/time"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/time_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="https://bbs.csdn.net/topics/@drawable/ic_time"
android:layout_centerVertical="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/time_icon">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/time_text"
android:textSize="15dp"
android:text="@string/time"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set_time"
android:textSize="15dp"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:id="@+id/repeat">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="https://bbs.csdn.net/topics/@drawable/ic_repeat"
android:layout_centerVertical="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/repeat_ll"
android:layout_toRightOf="@+id/repeat_icon">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_text"
android:textSize="15dp"
android:text="@string/repeat"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set_repeat"
android:textSize="15dp"
/>
</LinearLayout>
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_switch"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:layout_marginLeft="8dp"
android:onClick="onSwitchRepeat"
android:checked="true"
android:textOn="On"
android:textOff="Off"/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
android:onClick="setRepeatNo"
android:id="@+id/repeat_no"
android:background=""
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_no_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="https://bbs.csdn.net/topics/@drawable/ic_repeat_no"
android:layout_centerVertical="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/repeat_no_icon">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_no_text"
android:textSize="15dp"
android:text="@string/repetition_interval"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set_repeat_no"
android:textSize="15dp"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:clickable="true"
android:onClick="selectRepeatType"
android:id="@+id/repeat_type"
android:background="@mipmap/ic_launcher"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_type_icon"
android:layout_alignParentLeft="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="32dp"
android:src="https://bbs.csdn.net/topics/@drawable/ic_repeat_no"
android:layout_centerVertical="true"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toRightOf="@+id/repeat_type_icon">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/repeat_type_text"
android:textSize="15dp"
android:text="@string/type_of_repetitions"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/set_repeat_type"
android:textSize="15dp"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/starred1"
android:clickable="true"
android:onClick="selectFab1"
fab:fab_icon="@drawable/notification_off"
fab:fab_colorNormal="@color/colorAccent"
fab:fab_colorPressed="@color/colorPrimary"
app:fab_size="mini"
android:layout_alignParentRight="true"
android:layout_marginTop="170dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"/>
<com.getbase.floatingactionbutton.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/starred2"
android:clickable="true"
android:onClick="selectFab2"
fab:fab_icon="@drawable/notification_on"
fab:fab_colorNormal="@color/colorAccent"
fab:fab_colorPressed="@color/colorPrimary"
app:fab_size="mini"
android:layout_alignParentRight="true"
android:layout_marginTop="170dp"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"/>
<CheckBox
android:id="@+id/checkBox_completed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/add_reminder_layout_top"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="11dp"
android:layout_marginLeft="48dp"
android:layout_marginStart="48dp"
android:text="Completed" />
<CheckBox
android:id="@+id/checkBox_failed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/checkBox_completed"
android:layout_alignBottom="@+id/checkBox_completed"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginEnd="37dp"
android:layout_marginRight="37dp"
android:text="Failed" />
>
這是我的錯誤
Information:Gradle tasks [:app:generateReleaseSources, :app:mockableAndroidJar]
C:\Users\ghjsk\AndroidStudioProjects\NavDrawer\app\src\main\res\layout\activity_add_reminder.xml
Error:error: '' is incompatible with attribute android:background (attr) reference|color.
Error:'' is incompatible with attribute android:background (attr) reference|color.
Error:failed linking file resources.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processReleaseResources'.
> Failed to execute aapt
Information:BUILD FAILED in 18s
Information:7 errors
Information:0 warnings
Information:See complete output in console
uj5u.com熱心網友回復:
你的RelativeLayout中有id:id / repeat_no的android:background =“”.洗掉或設定正確的值應解決問題.uj5u.com熱心網友回復:
[align=left]<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android">
<group android:id="@+menugroup/new_activity_menugroup">
<item android:id="@+menuitem/about" android:title="關于"
android:icon="@android:drawable/ic_menu_info_details" />
<item android:id="@+menuitem/cancel" android:title="退出"
android:icon="@android:drawable/ic_menu_close_clear_cancel" />
</group>
</menu>[/align]
我的這段代碼也出現了類似的報錯。
Android resource linking failed
D:\JDYdroid2\app\src\main\res\menu\menu_xml_file.xml:3: AAPT: error: '@+menugroup/new_activity_menugroup' is incompatible with attribute id (attr) reference.
D:\JDYdroid2\app\src\main\res\menu\menu_xml_file.xml:4: AAPT: error: '@+menuitem/about' is incompatible with attribute id (attr) reference.
D:\JDYdroid2\app\src\main\res\menu\menu_xml_file.xml:6: AAPT: error: '@+menuitem/cancel' is incompatible with attribute id (attr) reference.
該怎么解決啊
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/131164.html
標籤:其他技術討論專區
上一篇:本人持續更新云計算各種技術
下一篇:被稱為最接近神的人 特斯拉
