Generally, AAPT is packaging an application with fixed resource id, and the id value is starting with "0x7f".
I want to replace this integer value with other value, like "0x6f" or something.
I found the code line to handle this, and modified the aapt code. (path : /frameworks/base/tools/aapt/)
But, when building an application, I got the build error message like:
/apps/myapps/AndroidManifest.xml:9: error: Error: No resource found that matches the given name (at 'icon' with value '#drawable/ic_launcher_app')."\
Is there any way to solve this build error ?
According to this Android resources dev page you should never modify the R file yourself as it is generated automatically
Caution: You should never modify the R.java file by hand—it is generated by the aapt tool when your project is compiled. Any changes are overridden next time you compile.
That means ic_launcher_app image not in your drawable folder. And also if you change image format manually like .jpg to save as .Png without using any software that AAPT(while compile resources into binary assets) issue will occur.so use proper image formats.
Related
enter image description hereResource compilation failed (Failed to compile values resource file E:\AndroidStudioProjects\AuthenticApp2\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.lang.IllegalStateException: Can not extract resource from com.android.aaptcompiler.ParsedResource#4510599a.). Check logs for more details
Find and exchange all ' symbols in your strings.xml or somewhere else in your code with \'
Look into the resources in ids.xml file and comment out each id one by one and try to simulate the emulator. I also had this problem but when I removed the EditText id from the resources of ids.xml, then the issue was resolved.
Yesterday everything worked fine and the app get build successfully.
But when I want to build the app now, I always get the following error:
invalid resource directory name:
/path/to/project.android/obj/Debug/Ip/26/jl/res Icon "res Icon".
Does somebody know how to fix that?
It seems like you have a space character in the name of your resource file or directory which is not allowed:
"File-based resource names must contain only lowercase a-z, 0-9, or underscore"
I don't know how but this fixed my problem.
Use incremental Android packaging system (aapt2).
I am getting the following error when I build my Android App project in Visual studio 2015.
No resource found that matches the given name (at 'value' with value '#integer/google_play_services_version')
These lines are located under:
obj\Debug\android\manifest\AndroidManifest.xml
There is 3 entires of it inside the AndroidManifest file.
I have downloaded the google play service from the SDK Manager.
Should I reference anything to my solution?
I already has Xamarin.GooglePlayServices.Base, Xamarin.GooglePlayServices.Basement, Xamarin.GooglePlayServices.Maps Referenced.
Thanks.
you have create integer.xml file inside value folder and define your Integer to that place it will solve your problem.
Try doing and a clean all and check that ALL the content under the obj has been deleted and then perform a build all.
If that does not work:
I would try removing the ~GooglePlayServices~ nugets/references and re-add just the Xamarin.GooglePlayServices.Mapsnuget which will bring in the ~Basement and ~Base libraries.
You should end up with a generated manifest that only has one reference to google_play_services_version and that resource should be picked up from Debug/android/XXX/YYYYYY/ZZZZZ/R.java:
i.e.
public static final int google_play_services_version=0x7f070000;
I added several new packages. One of the package is the reason of the error. I have to check one by one and caught the one causing error. Removing that package is all I need to do to resolve the error.
I can't find a way to add images to drawable folder without getting "Cannot resolve symbol R" issue.
And once i get "Cannot resolve symbol R", I can't get rid of it by either clean, rebuild, sync, invalidate cache & restart solutions for the error. Only if i delete the files can I get the build to pass.
I am not sure what is wrong here.
Note: I am on Android Studio 2.1.1
I had exactly the same problem, and it was that I downloaded an "image.jpeg" extension from Internet and directly changed the extension saving it like "image.png", but Android studio still recognized it like image.jpeg.
I realized that when using top menu Analyze-Inpect code.
Once the inspection is finished a new window called 'Inspection' appears and in the follow carpets appears next:
Android > Lint > Usability > Icons
Icon format does not match the file extension
Misleading file extension; named .png but the file format is JPEG*
You are facing this issue because your drawable file name is either
having any capital letter or starting with a number or containing any special character like #,*,$ etc. rename it the
error will be gone.
You can use only small letters, underscore(_), numbers(not at beginning) & dot(.) in the name of drawable
For example the name could be ABC.png then rename it to abc.png and it will work.
1xYz.JPEG then rename it to _1xyz.jpeg
a#b.png then rename it to ab.png
After that clean and rebuild & there you Go..!!
I found that the extension of the file must match the actual format of the image.
For example, you will get this error if you changed the extension of an image from bmp to png and added it to the project
I'm getting this error when trying to build the application. The xml editor did not highlight both error as missing. As the file/string are already there.
android-apt-compiler: [XXX]
D:\private\xxx\android\XXX\src\AndroidManifest.xml:35: error: Error:
No resource found that matches the given name (at 'icon' with value
'#drawable/ic_launcher').
android-apt-compiler: [XXX]
D:\private\xxx\android\XXX\src\AndroidManifest.xml:233: error: Error:
No resource found that matches the given name (at 'value' with value
'#string/FacebookAppID').
The project structure is like this:
ProjectFolder
|-external_lib
|-src
|-src (actual source)
|-res
|-...
I can confirm that both file is already in the project. As I use IntelliJ, I could just Ctrl + click then it open those files for me. However, I'm still getting this error.
I checked with both Google and SO. Most of the issues were about not having the files or storing in different folders. Which I can ensure that it is in the right place alongside hundred other files and strings.
Another issue is about % sign in strings.xml. I tried searching for "%" and nothing is found in the file.
Shutting down IDE and reopen it doesn't help, nor rebuilding the project. How could I get the app to build?
Look for any error message during the resource compilation.
Sometimes, if you have resource filenames containing illegal characters (such as underscores or uppercase letters), the whole process fails almost silently, and the IDE can't find any resources anymore.
I'm not sure that it's what is happening in your case, but I did eventually encounter such issues...