The attached example is defined for adaptive icon like the tutorial - as much as I can think of:
The manifest is for 26 only, the changes done like in the tutorial.
Version of android is 27.
Files in the mipmap directory are read-only.
No icon is set in "project - choose icon".
B4a version - 7.30
The app is failing while looking for the icon's drawable.
Please check what I'm doing wrong...
Thanks.
Thank you, I corrected the spelling but the problem is still there, like I wrote above - it looks for the ic_launcher:
Logger connected to: Google Pixel
--------- beginning of crash
--------- beginning of main
java.lang.RuntimeException: Unable to start activity ComponentInfo{derez.iconstest/derez.iconstest.main}: android.content.res.Resources$NotFoundException: Drawable derez.iconstest:mipmap/ic_launcher with resource ID #0x7f030002
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: android.content.res.Resources$NotFoundException: Drawable derez.iconstest:mipmap/ic_launcher with resource ID #0x7f030002
Caused by: android.content.res.Resources$NotFoundException: File res/mipmap-anydpi-v26/ic_launcher.xml from drawable resource ID #0x7f030002
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:820)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:630)
at android.content.res.Resources.getDrawableForDensity(Resources.java:877)
at android.content.res.Resources.getDrawable(Resources.java:819)
at android.content.Context.getDrawable(Context.java:605)
at com.android.internal.widget.ToolbarWidgetWrapper.setIcon(ToolbarWidgetWrapper.java:322)
at com.android.internal.widget.ActionBarOverlayLayout.setIcon(ActionBarOverlayLayout.java:742)
at com.android.internal.policy.PhoneWindow.setDefaultIcon(PhoneWindow.java:1756)
at android.app.Activity.initWindowDecorActionBar(Activity.java:2655)
at android.app.Activity.setContentView(Activity.java:2690)
at derez.iconstest.main.onCreate(main.java:59)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: android.content.res.Resources$NotFoundException: File res/mipmap-anydpi-v26/ic_launcher.xml from xml type drawable resource ID #0x7f030002
at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1163)
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:805)
... 23 more
Caused by: java.io.FileNotFoundException: Corrupt XML binary file
at android.content.res.AssetManager.openXmlAssetNative(Native Method)
at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:546)
at android.content.res.ResourcesImpl.loadXmlResourceParser(ResourcesImpl.java:1148)
... 24 more
Based on the info you posted in the other thread (you are using Android.jar from api 26) i fear that you are using an OLD SDK Installation.
I want suggest to install a new SDK in a blank folder. And try it again with the newly installed SDK (dont forget to adapt the path to the android.jar from the new installation.
You can find the Setup-Instructions here. https://www.b4x.com/b4a.html
You also can watch this Video as it describes it clearly.
Start with a new Blank folder like you see in the Video.
Thank you DonManfred, you were right - I installed the sdk using the b4a sdk manager to a new directory, now it works !
Now I can play with icons and try to overcome Google's annoying design.