getting \" 'android:icon' attribute: attribute is not a string value” error while uploading an APK to the play store

瘦欲@ 提交于 2019-12-02 23:43:56
Pablo_Cassinerio

If you are using any android system icons as activity icons (i.e. manifest contains <activity ... android:icon="@android:drawable/... ) , they could be the problem. If you are, try copying these icons into your project. Using them elsewhere should be no problem since badging doesn't touch those.

for me it was the fact that I tried to put transparent icons like this:

android:icon="@android:color/transparent"

In my case, the issue was simply that one of my app's dependencies had declared one of their activities to use android:icon="@color/black" in their manifest, instead of using a drawable. You don't get any compilation errors, and the apps works just fine. Only the aapt tool reports the error (or uploading to the Playstore). Note, libraries don't even need android:icon to be declared (they're not an installable app!) but AndroidStudio appears to default all projects to declare one in the manifest.

I know that there is correct answer, but i believe that my experience can help some one...

so i receive the same error:

ERROR getting 'android:icon' attribute: attribute is not a string value

but my problem wasn't related with icon!!!

The reason why I get this error was here:

android:label="@string/app_name"

My project has 3 different languages, but the main string.xml was without @string/app_name... and this was the reason!

so be careful!

I see you tried everything i guess. Try changing icon maybe? :) I mean only possiblity that left is your icon.

Try creating separate layouts for different screen sizes. Name the folders as res/layout and res/layout-large

I think I was hit by this issue (or something similar, not sure) when I tried to use an XML drawable as the icon (to add padding, etc. to the PNG image). I don't think your issue is the same though, since you seem to refer to the PNG file directly.

Some suggestions to try (to track down the problem by process of elimination):

  • Remove res/drawable-mdpi/app_icon.png file and see if you got a different error.
  • Remove all android:icon attributes in your manifest and see if you still got the error.
  • Rename any other resource named app_icon in the project to something else.

If all else fail, I would probably start stripping out the external JARs and library projects (and probably temporarily commenting the code that refer to them) just to see if the error was triggered by any of them. Or maybe start fresh with a bare minimum AndroidManifest.xml and add your stuff one item at a time.

Another idea is to try to figure out why aapt is producing the error. Maybe download the source and try to debug it?

Have you tried turning your computer off and then on again?

Try removing android:icon="@drawable/app_icon from the Activity, as it will fall back to the icon specified in the Application.

Try not using proguard.

In may case, the problem is because I used @null for the value. Completely removing that fixes it. The same happens when you put @null for android:icon.

I was getting the same issue today and the @Rahl_Pryde's solution worked fine with a minor change.

In my case, the problem was an android transparent res color to some of my Activity icons. But changing to a local transparent color doesn't fixed the problem.

It fixed when changed the icon from a transparent color to a 2x2 transparent png.

In my case I have solved it by using always default res folders ie values, values-es, values-ca

RadekJ

In my case the problem was occuring because I changed package name before releasing and forgot about changing directory names. Project was still compiling but it was impossible to release it on google play.

Check in any java file if you have red underlined package name with error

'Package name xxx.yyy.zzz does not correspond to the file path 'xxx.eee.zzz'.

In my case, copied the png I use for my app icon into my "drawable-nodpi" folder and the Play store accepted my apk. If you don't have a nodpi folder, then maybe you just need to copy it out of your bucket size related drawable folders, and paste it into the base folder "drawable."

This seems to be a recent Play store requirement, since I've never seen this error before today. Take note of androiddeveloper's comment as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!