[crash] drawable resource crash - common problem on android api 21
Closed this issue · 1 comments
its common problem on android api 21, can be solved by adding res pngs for this android version
Caused by android.content.res.Resources$NotFoundException: File res/drawable/quickie_bg_torch.xml from drawable resource ID #0x7f0802d1
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2590)
at android.content.res.Resources.loadDrawable(Resources.java:2487)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.view.View.(View.java:3745)
at android.widget.ImageView.(ImageView.java:139)
at android.widget.ImageView.(ImageView.java:135)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieTorchImageviewBinding.inflate(QuickieTorchImageviewBinding.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieScannerActivityBinding.inflate(QuickieScannerActivityBinding.java:1)
at io.github.g00fy2.quickie.QRScannerActivity.onCreate(QRScannerActivity.java:1)
at android.app.Activity.performCreate(Activity.java:6052)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5431)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Caused by android.content.res.Resources$NotFoundException: File res/color/quickie_bg_torch_color_selector.xml from color state list resource ID #0x7f06014e
at android.content.res.Resources.loadColorStateList(Resources.java:2703)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:427)
at android.graphics.drawable.GradientDrawable.updateGradientDrawableSolid(GradientDrawable.java:1296)
at android.graphics.drawable.GradientDrawable.inflateChildElements(GradientDrawable.java:1180)
at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:1019)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1128)
at android.graphics.drawable.LayerDrawable.inflateLayers(LayerDrawable.java:204)
at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:145)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1128)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1032)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2575)
at android.content.res.Resources.loadDrawable(Resources.java:2487)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.view.View.(View.java:3745)
at android.widget.ImageView.(ImageView.java:139)
at android.widget.ImageView.(ImageView.java:135)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieTorchImageviewBinding.inflate(QuickieTorchImageviewBinding.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieScannerActivityBinding.inflate(QuickieScannerActivityBinding.java:1)
at io.github.g00fy2.quickie.QRScannerActivity.onCreate(QRScannerActivity.java:1)
at android.app.Activity.performCreate(Activity.java:6052)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5431)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Caused by android.content.res.Resources$NotFoundException: Resource ID #0x7f060150 type #0x2 is not valid
at android.content.res.Resources.getColor(Resources.java:976)
at android.content.res.ColorStateList.inflate(ColorStateList.java:228)
at android.content.res.ColorStateList.createFromXmlInner(ColorStateList.java:152)
at android.content.res.ColorStateList.createFromXml(ColorStateList.java:131)
at android.content.res.Resources.loadColorStateList(Resources.java:2699)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:427)
at android.graphics.drawable.GradientDrawable.updateGradientDrawableSolid(GradientDrawable.java:1296)
at android.graphics.drawable.GradientDrawable.inflateChildElements(GradientDrawable.java:1180)
at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:1019)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1128)
at android.graphics.drawable.LayerDrawable.inflateLayers(LayerDrawable.java:204)
at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:145)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:1128)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:1032)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:2575)
at android.content.res.Resources.loadDrawable(Resources.java:2487)
at android.content.res.TypedArray.getDrawable(TypedArray.java:749)
at android.view.View.(View.java:3745)
at android.widget.ImageView.(ImageView.java:139)
at android.widget.ImageView.(ImageView.java:135)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at androidx.appcompat.widget.AppCompatImageView.(AppCompatImageView.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieTorchImageviewBinding.inflate(QuickieTorchImageviewBinding.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at io.github.g00fy2.quickie.QROverlayView.(QROverlayView.java:8)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at io.github.g00fy2.quickie.databinding.QuickieScannerActivityBinding.inflate(QuickieScannerActivityBinding.java:1)
at io.github.g00fy2.quickie.QRScannerActivity.onCreate(QRScannerActivity.java:1)
at android.app.Activity.performCreate(Activity.java:6052)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2332)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5431)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Hi @kochchy, thanks for reaching out!
Looks like you are using version 1.2.0 or 1.2.1 (I see the quickie_bg_torch_color_selector.xml
in the stacktrace which was already removed). This issue is fixed with 1.2.2 (was not related to vector drawables, API 21 fully supports them)
Please check it out and feel free to reopen this issue if you still see the error.