所以我試圖創建一個自定義主題給我的preference_category文件,但後來決定刪除它。我從styles.xml中刪除了一個主題,從AndroidManifest.xml中刪除了一個字符串。當我建立這個項目時,它總是從死裏復活。每次我刪除它,它都在恢復。和字符串android:theme =「@ style/Theme.Custom」一樣從未被刪除!我得到的錯誤是我創建了一個自定義主題,刪除它,然後無法從AndroidManifest.xml中刪除它
Error:(51, 28) No resource found that matches the given name (at 'theme' with value '@style/Theme.Custom'). Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/lisa/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1 Information:BUILD FAILED
而不僅僅是這樣。我的manifest資源配置文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tenderplan"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<application
android:allowBackup="true"
android:icon="@drawable/notif"
android:label="Tenderplan"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.tenderplan.activities.MainActivity"
android:label="Tenderplan"
android:theme="@style/AppTheme.NoActionBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.tenderplan.activities.LoginActivity"
android:theme="@style/AppTheme" />
<activity
android:name="com.example.tenderplan.activities.ElementActivity"
android:theme="@style/AppTheme" />
<activity
android:name="com.example.tenderplan.activities.SettingsActivity"
android:label="@string/title_activity_settings"
android:theme="@style/Theme.Custom" />
<activity android:name="com.example.tenderplan.activities.EditActivity" />
<activity android:name="com.example.tenderplan.activities.AddKeyActivity" />
<activity android:name="com.example.tenderplan.activities.AnalyticsActivity" />
<activity android:name="com.example.tenderplan.activities.AnalyticsCPActivity" />
</application>
清單中這些字符串是紅色:
http://schemas.android.com/apk/res/android"
android:versionCode="1" android:versionName="1.0" >
- 支持屏
android:allowBackup="true" android:icon="@drawable/notif"
android:theme="@style/AppTheme"
和許多其他主題。
這是我的styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay"
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay"
parent="ThemeOverlay.AppCompat.Light" />
而且,我import com.example.tenderplan.R;
不能在活動中找到。
你能幫我找到正確答案嗎?
你有沒有嘗試清理項目和運行? – Raghavendra
檢查在建立文件夾或src文件夾中確切顯示錯誤「清單」的位置? – Raghavendra
是的,我清理並重新啓動了幾次,但同樣的錯誤。 在生成文件夾中。 –