Like the title suggests, all of a sudden, my Android Studio projects simply can’t locate any of my drawable resources that I call when using android:background="@drawable/serving_editor_background"
for example, it’ll just give me this error code for every single drawable that has been called:
AAPT: error: resource drawable/serving_editor_background (aka com.example.poop123:drawable/serving_editor_background) not found.
Execution failed for task ':app:mergeDebugResources'.
> com.android.build.gradle.tasks.ResourceException (no error message)
ParseError at [row,col]:[2,6]
Message: The processing instruction target matching "[xX][mM][lL]" is not allowed.
It literally does it for every single one (with their respective names and file path), all of the ones that used to work up until now, not a single one works, and I never changed anything in the gradle, but I’ll still provide it:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.poop123"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.3.2'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.72'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:+'
implementation 'com.google.firebase:firebase-database:20.0.2'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.wear:wear:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
compileOnly 'com.google.android.wearable:wearable:2.6.0'
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.poop123">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Poop123">
<activity android:name=".EditAddition"></activity>
<activity android:name=".ConfirmAddition" />
<activity android:name=".Goal" />
<activity android:name=".ActivityLevel" />
<activity android:name=".newFoodMenu" />
<activity android:name=".foodLibrary" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I’m getting really frustrated at this, because I changed absolutely nothing (just a specific XML code for a certain activity), and now none of the drawables can be found.
If any more info, let me know.
2
Answers
Bascially, I loaded up an old version of the project, copy pasted all the new code into the current project, noticed that on one of the drawable's, I had an extra
And for some reason it completely clogged up the whole thing, and the exception messages it gave, had 0 to do with it in a sense, had to manually find the problem myself.
First of all locate the drawable folder of your project and see the resources. if you found the resources try android:src="@drawable/resource"