5.1 Crash - A TaskDescription's primary color should be opaque

I have implemented material design into my app and it runs perfectly fine on < Android 5 but when I try to run on Android 5.0 and above I get the following in my logcat.

     FATAL EXCEPTION main
 Process com.test.test, PID 3195
 java.lang.RuntimeException Unable to start activity ComponentInfo{com.test.test/com.test.test.MainActivity} java.lang.RuntimeException A TaskDescription's primary color should be opaque
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java2298)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java2360)
    at android.app.ActivityThread.access$800(ActivityThread.java144)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java1278)
    at android.os.Handler.dispatchMessage(Handler.java102)
    at android.os.Looper.loop(Looper.java135)
    at android.app.ActivityThread.main(ActivityThread.java5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java694)
 Caused by java.lang.RuntimeException A TaskDescription's primary color should be opaque
    at android.app.ActivityManager$TaskDescription.<init>(ActivityManager.java536)
    at android.app.Activity.onApplyThemeResource(Activity.java3677)
    at android.view.ContextThemeWrapper.initializeTheme(ContextThemeWrapper.java140)
    at android.view.ContextThemeWrapper.setTheme(ContextThemeWrapper.java85)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java2244)
    ... 10 more

And here is my styles:

    <resources>

    <!--
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.


    -->


    <!-- All customizations that are NOT specific to a particular API-level can go here. -->

    <style name="AppTheme" parent="@style/Theme.AppCompat.NoActionBar">

        <!-- All customizations that are NOT specific to a particular API-level can go here. -->

        <item name="colorPrimaryDark">#4DFF9800</item>
        <item name="colorPrimary">#4D607D8B</item>
    </style>

</resources>

If anyone could give me some guidance that would be great thanks.

You can not use alfa in primary color. The primary color has to be opaque.

Change:

<item name="colorPrimaryDark">#4DFF9800</item>
<item name="colorPrimary">#4D607D8B</item>

To

<item name="colorPrimaryDark">#FF9800</item>
<item name="colorPrimary">#607D8B</item>

for api 21 in res/values-v21/style.xml file

5.1 Crash, 5.1 Crash - A TaskDescription's primary color should be opaque. I have implemented material design into my app and it runs perfectly fine on < Android 5 but� 5.1 Crash – основной цвет задачи TaskDescription должен быть непрозрачным Я внедрил материальный дизайн в свое приложение, и он отлично работает на <Android 5, но когда я пытаюсь запустить на Android 5.0 и выше

Simple solution to the issue is to remove the opaque applied to the primary color in colors.xml

When opaque is applied to primary color the color code look like this "#aca688ff", where it has to be ex: "#F50057" (6 letters alphanumeric code without opaque).

Hope the above solution helps you to fix the issue.

5.1 Crash - A TaskDescription's primary color should be , 5.1 Crash - A TaskDescription's primary color should be opaque. Question. I have implemented material design into my app and it runs perfectly fine on� ActivityManager.TaskDescription taskDescription = new ActivityManager.TaskDescription("AppName", bm ,R.color.colorPrimaryDark); 5.1 Crash - A TaskDescription's

@Konrad Krakowiak is right. You can see the source code of android.app.ActivityManager#TaskDescription.

/**
    * Creates the TaskDescription to the specified values.
    *
    * @param label A label and description of the current state of this task.
    * @param icon An icon that represents the current state of this task.
    * @param colorPrimary A color to override the theme's primary color. This color must be opaque.
    */
    public TaskDescription(String label, Bitmap icon, int colorPrimary) {
      if ((colorPrimary != 0) && (Color.alpha(colorPrimary) != 255)) {
        throw new RuntimeException("A TaskDescription's primary color should be opaque");
      }

      mLabel = label;
      mIcon = icon;
      mColorPrimary = colorPrimary;
    }

android — 5.1 Crash, 5.1 Crash - La couleur principale d'une TaskDescription doit �tre opaque. J'ai impl�ment� la conception mat�rielle dans mon application et elle fonctionne� I have been using Aslains for a long time never had this issue. I installed the latest patch (1.5.1.1_00), and after that when I click the play button it says loading then crashes. I did the integrity check. It will load into Safe mode no problem. I ran the installer twice (from a different link

Error java.lang.RuntimeException: A TaskDescription's primary color should be opaque

Answer: go to your app-->value-->color and look at your primary color and count the characters there It must have six hexa characters(like #FDEF25).. It must not have more than six characters.

Here is the video for easiness

5.1 Crash-основной цвет a TaskDescription должен быть , 5.1 Crash-основной цвет a TaskDescription должен быть непрозрачным. Я внедрил material design в свое приложение, и оно отлично работает на� This APK is signed by joaomgcd and upgrades your existing app. APK certificate fingerprints SHA-1: feadd18b23781cfd4eac71118c76fb35c1ab39c7 SHA-256

android, 5.1 Crash - A TaskDescription's primary color should be opaque. I have implemented material design into my app and it runs perfectly fine on < Android 5 but� Description: Driver for AMD Radeon HD 6450 Radeon Software Adrenalin 2020 Edition 20.3.1 Support For DOOM™ Eternal Achieve up to 5%­ better performance playing Doom Eternal (Ultra Nightmare settings) at 1920x1080p on the Radeon™ RX 5700XT with Radeon™ Software Adrenalin 2020 Edition 20.3.1, versus Radeon™ Software Adrenalin 2020 Edition 20.2.2.

5.1 Crash – El color primario de TaskDescription debe ser opaco , 5.1 Crash – El color primario de TaskDescription debe ser opaco. He implementado el dise�o de material en mi aplicaci�n y se ejecuta perfectamente bien en� 109-Year-Old Veteran and His Secrets to Life Will Make You Smile | Short Film Showcase - Duration: 12:39. National Geographic Recommended for you

A TaskDescription's primary color should be opaque, I encounter with the same error as described here. https://forums.expo.io/t/a- taskdescriptions-primary-color-should-be-opaque/11390 stack� Unable to change accent color in Android - Java Exception: A TaskDescription's primary color should be opaque #17 Open ahmedkhan25 opened this issue Feb 5, 2016 · 6 comments

Comments
  • myself not working this solution . i tested android 6.0
  • @SathishKumarJ Could you create gist with your code?
  • check my question here stackoverflow.com/questions/41298162/…
  • please clarify in which cases it has to be opaque cause I can use transparent color for colorPrimary on Marshmallow 6.0.1 without any problem.. I don't have a Lollipop device so can't test it
  • It is no problem with Android 6, it is no problem with Android 4.4, but this exception is thrown with Android 5.1!!! Isn't there a good solution that does not require to degrade the color of my app?
  • don't forget to click on "up arrow button" if it is useful. :)