android-about-page icon indicating copy to clipboard operation
android-about-page copied to clipboard

setIcon giving force close

Open lesjaw opened this issue 8 years ago • 5 comments

halo there, awesome work..

i create a new element, if I .setIcon from mipmap or drawable using png make about page force close, except if i put a vector file in drawable-nodpi folder..

here is the logcat..

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.olmatix.config.lesjaw.configolmatix, PID: 9539 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.olmatix.config.lesjaw.configolmatix/com.olmatix.config.lesjaw.amazara.AboutActivity}: android.content.res.Resources$NotFoundException: File res/drawable-nodpi-v4/wa.png from xml type xml resource ID #0x7f020060 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2311) at android.app.ActivityThread.access$1000(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1254) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5159) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610) at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: File res/drawable-nodpi-v4/wa.png from xml type xml resource ID #0x7f020060 at android.content.res.Resources.loadXmlResourceParser(Resources.java:2358) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2313) at android.content.res.Resources.getXml(Resources.java:988) at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:413) at mehdi.sakout.aboutpage.AboutPage.createItem(AboutPage.java:360) at mehdi.sakout.aboutpage.AboutPage.addItem(AboutPage.java:243) at com.olmatix.config.lesjaw.amazara.AboutActivity.onCreate(AboutActivity.java:33) at android.app.Activity.performCreate(Activity.java:5239) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2311)  at android.app.ActivityThread.access$1000(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1254)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5159)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)  at dalvik.system.NativeStart.main(Native Method)  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:488) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2340) at android.content.res.Resources.loadXmlResourceParser(Resources.java:2313)  at android.content.res.Resources.getXml(Resources.java:988)  at android.support.graphics.drawable.VectorDrawableCompat.create(VectorDrawableCompat.java:413)  at mehdi.sakout.aboutpage.AboutPage.createItem(AboutPage.java:360)  at mehdi.sakout.aboutpage.AboutPage.addItem(AboutPage.java:243)  at com.olmatix.config.lesjaw.amazara.AboutActivity.onCreate(AboutActivity.java:33)  at android.app.Activity.performCreate(Activity.java:5239)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2225)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2311)  at android.app.ActivityThread.access$1000(ActivityThread.java:148)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1254)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5159)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:610)  at dalvik.system.NativeStart.main(Native Method) 

lesjaw avatar Dec 12 '16 17:12 lesjaw

Still the case ?

medyo avatar Feb 19 '17 23:02 medyo

I am having the same issues as well. I've tried with both PNG's and .xml images. It seems to be an issue in API 18 only, as far as I know.

I've also tried setting the support library of vectorDrawables to true. vectorDrawables.useSupportLibrary = true

Any news on this ?

Error message:

android.content.res.Resources$NotFoundException: File res/drawable-xhdpi-v4/ic_attach_money.png from xml type xml resource ID #0x7f080078. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info.

jangerhard avatar Nov 12 '17 13:11 jangerhard

@medyo I have the exact same issue.

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Package.Name/com.Package.Name.WhatsNew}: android.content.res.Resources$NotFoundException: File res/drawable/ic_about_new_release.png from xml type xml resource ID #0x7f070091
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2429)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
       at android.app.ActivityThread.access$800(ActivityThread.java:166)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.app.ActivityThread.main(ActivityThread.java:5590)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
       at dalvik.system.NativeStart.main(NativeStart.java)

I have tried everything, but still get this crash.

It's been 2 years since this issue was opened?

My crashlytics points to this line - https://github.com/medyo/android-about-page/blob/master/library/src/main/java/mehdi/sakout/aboutpage/AboutPage.java#L563


Edit:

I tried using a .jpeg instead of .png, I also tried applying vectorDrawables.useSupportLibrary = true in my gradle.

The above didn't work.

I get this crash in devices running 4.1.1 and 4.4.4

HBiSoft avatar Jan 22 '19 15:01 HBiSoft

@jangerhard @lesjaw Where you able to find the issue, if so, can you please share what you did?

HBiSoft avatar Jan 22 '19 17:01 HBiSoft

Ok I managed to find a solution, instead of using .jpeg or .png I use a vector drawable.

HBiSoft avatar Jan 22 '19 17:01 HBiSoft