Android Question AppCompat Error Samsung and other devices

rscheel

Well-Known Member
Licensed User
Longtime User
I have this error that I get it in samsung devices and in a tablet gear with android 6.0.1, only in those devices in other does not give error.

The error I get it to display only if I remove the filter of the log, if not, it does not show error, only the application drops to the beginning.

I'm using AppCompat v3.52 and B4a v7.01


B4X:
Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
Bridge logger not enabled.
Shutting down VM
java.lang.RuntimeException: Unable to start activity ComponentInfo{cl.inclinometro.avlchile/cl.inclinometro.avlchile.main}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    at android.app.ActivityThread.-wrap11(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5418)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:359)
    at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)
    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:280)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
    at cl.inclinometro.avlchile.main.onCreate(main.java:59)
    at android.app.Activity.performCreate(Activity.java:6266)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    ... 9 more
FATAL EXCEPTION: main
Process: cl.inclinometro.avlchile, PID: 2131
java.lang.RuntimeException: Unable to start activity ComponentInfo{cl.inclinometro.avlchile/cl.inclinometro.avlchile.main}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    at android.app.ActivityThread.-wrap11(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5418)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:359)
    at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:328)
    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:280)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:145)
    at cl.inclinometro.avlchile.main.onCreate(main.java:59)
    at android.app.Activity.performCreate(Activity.java:6266)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    ... 9 more
Initialized EGL, version 1.4
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
What theme are you using? Post your Manifest please
 
Upvote 0

rscheel

Well-Known Member
Licensed User
Longtime User
My Manifest

What theme are you using? Post your Manifest please

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="22"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

SetApplicationAttribute(android:theme, "@style/MyAppTheme")

CreateResource(values, theme.xml,
<resources>
    <style name="MyAppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">#FF2196F3</item>
        <item name="colorPrimaryDark">#007CF5</item>
        <item name="colorAccent">#FFFF3D00</item>
        <!--<item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="windowActionModeOverlay">true</item>-->
    </style>
</resources>
)
 
Upvote 0
Top