question-mark

Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting "Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x101009b a=3}" on Huawei device API 19

See original GitHub issue

Issue Description

I strangely get the following exception with ACRA 4.6.2 on a reported Huawei device. It’s so weird, cause ACRA is running on my device with API21 and working like a charm, but I’m facing this problem on API19. Even when the user tries to send error with clicking on the error reporting notification to open dialog, no dialog opens and a new notification get created again and so on.

Here is the stack trace:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sdghasemi.Scheduler/org.acra.CrashReportDialog}: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x101009b a=3}
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2264)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)
at android.app.ActivityThread.access$1100(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5336)
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:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x101009b a=3}
at android.content.res.Resources.loadColorStateList(Resources.java:2301)
at com.huawei.android.content.res.ResourcesEx.loadColorStateList(ResourcesEx.java:752)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:370)
at android.widget.TextView.<init>(TextView.java:711)
at android.widget.TextView.<init>(TextView.java:637)
at android.widget.TextView.<init>(TextView.java:633)
at org.acra.CrashReportDialog.buildCustomView(CrashReportDialog.java:67)
at org.acra.CrashReportDialog.onCreate(CrashReportDialog.java:43)
at android.app.Activity.performCreate(Activity.java:5302)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2228)
... 11 more
android.content.res.Resources$NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x2/d=0x101009b a=3}
at android.content.res.Resources.loadColorStateList(Resources.java:2301)
at com.huawei.android.content.res.ResourcesEx.loadColorStateList(ResourcesEx.java:752)
at android.content.res.TypedArray.getColorStateList(TypedArray.java:370)
at android.widget.TextView.<init>(TextView.java:711)
at android.widget.TextView.<init>(TextView.java:637)
at android.widget.TextView.<init>(TextView.java:633)
at org.acra.CrashReportDialog.buildCustomView(CrashReportDialog.java:67)
at org.acra.CrashReportDialog.onCreate(CrashReportDialog.java:43)
at android.app.Activity.performCreate(Activity.java:5302)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2228)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2313)
at android.app.ActivityThread.access$1100(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5336)
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:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:681)
at dalvik.system.NativeStart.main(Native Method)

Is there a way to fix it? Any help would be appreciated

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Sdghasemicommented, Feb 9, 2016

Finally found the problem! I was configuring dialog theme with new Theme.AppCompat.Light.Dialog.Alert which requires to invoke only with android.support.v7.app.AlertDialog.Builder(Context ctx, int theme) and also needs to pass declared theme as theme parameter in its Builder constructor. While ACRA (all dialog versions) uses android.app.AlertDialog that uses device default dialog theme from each SDK API version to illustrate the dialog. The problem solved when I used default dialog theme for each SDK version as my CrashDialog theme. (as described here)

Thank you very much for your quick support. It really helped narrow it down

0reactions
william-ferguson-aucommented, Feb 9, 2016

That’s great.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resource is not a ColorStateList (color or path) - Stack Overflow
Hi Merk, that value maps to the R$style attribute CustomActionBar = 0x7f0d014c; Which you can see is defined above, is defined for all...
Read more >
Adapting a Quick App to the Dark and Light Modes
Method 1: Using the MediaQuery Responsive Layout (Recommended). In the responsive layout of HUAWEI Quick App, the Media Feature class contains the prefers-color...
Read more >
Cases-Quick App Development-Quick App
If the button color is not set, the effect is the same as that of the ... the quick app freezes when rendering...
Read more >
Obtaining the API Level-App Development-Health Industry ...
In this case, you need to update the server. If the API level of the client-side SDK is lower than or the same...
Read more >
FAQs-Quick App Development-Quick App | HUAWEI Developers
I have applied for the permission to obtain phone numbers, but the API for obtaining phone numbers based on HUAWEI IDs does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found