'Android - Compilation issue-Build Analyzer [duplicate]

I am making a project in android with java of a chat with firebase to collect data. The problem is that I have finished it and it compiles well without giving errors since everything is corrected (or everything is supposed to be), however, the application only opens on my mobile device, but in the android emulator itself or in others devices does not open. I come to the conclusion that it is a Build issue, however no matter how much I look at things on the internet and try to solve it, I cannot find a definitive solution. Attached images:

-These two photos are from the correct build of the Build Output: https://1drv.ms/u/s!At-luScEjfj4g4tMO7DEepUwelQ-gg?e=GC0Tgy https://1drv.ms/u/s!At-luScEjfj4g4tN7vuFH7wYnaTJiA?e=wQkOXJ

-And this is the image of the Build Analyzer that tells me what I should do, but I can't solve it: https://1drv.ms/u/s!At-luScEjfj4g4tOIjH3sI35JckQ0g?e=lUYgS6

Let's see if someone can give me a cable, I would greatly appreciate it. All the best.



Solution 1:[1]

This is what i get when i debbug

 05/15 18:48:02: Launching 'app' on realme RMX2001.
Install successfully finished in 2 s 634 ms.
$ adb shell am start -n "com.example.chattfg/com.example.chattfg.Register" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.chattfg
Connecting to com.example.chattfg
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/oplus.android.OplusFrameworkFactoryImpl: get feature:IOplusScreenModeFeature
I/oplus.android.OplusFrameworkFactoryImpl: getOplusScreenModeFeature
W/ActivityThread: Application com.example.chattfg is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:61024', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1480)
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
E/Parcel: Reading a NULL string not supported here.
I/DynamiteModule: Considering local module com.google.android.gms.measurement.dynamite:73 and remote module com.google.android.gms.measurement.dynamite:72
I/DynamiteModule: Selected local version of com.google.android.gms.measurement.dynamite
E/Parcel: Reading a NULL string not supported here.
E/Parcel: Reading a NULL string not supported here.
I/FirebaseInitProvider: FirebaseApp initialization successful
E/ANR_LOG: >>> msg's executing time is too long
E/ANR_LOG: Blocked msg = { when=-3s240ms what=110 target=android.app.ActivityThread$H obj=AppBindData{appInfo=ApplicationInfo{aa671fa com.example.chattfg}} } , cost  = 3214 ms
E/ANR_LOG: >>>Current msg List is:
E/ANR_LOG: Current msg <1> = { when=-3s233ms what=159 target=android.app.ActivityThread$H obj=ClientTransaction LaunchActivityItem,ResumeActivityItem }
E/ANR_LOG: Current msg <2> = { when=-3s228ms what=159 target=android.app.ActivityThread$H obj=ClientTransaction TopResumedActivityChangeItem, }
E/ANR_LOG: Current msg <3> = { when=-3s220ms what=9999 target=android.app.ActivityThread$H }
E/ANR_LOG: Current msg <4> = { when=-2s201ms what=0 target=android.app.ActivityThread$H callback=android.app.-$$Lambda$ActivityThread$A4ykhsPb8qV3ffTqpQDklHSMDJ0 }
E/ANR_LOG: Current msg <5> = { when=+861ms what=131 target=android.app.ActivityThread$H obj=android.app.ActivityThread$ProviderRefCount@f4e3ab }
E/ANR_LOG: Current msg <6> = { when=+1s5ms what=131 target=android.app.ActivityThread$H obj=android.app.ActivityThread$ProviderRefCount@17855a1 }
E/ANR_LOG: >>>CURRENT MSG DUMP OVER<<<
E/libEGL: Invalid file path for libcolorx-loader.so
V/FA: App measurement collection enabled
V/FA: App measurement enabled for app package, google app id: com.example.chattfg, 1:1052096020698:android:05e4238c24c0ccc9a565e3
I/FA: App measurement initialized, version: 64000
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.example.chattfg
D/FA: Debug-level message logging enabled
V/FA: Persisting first open: 1652633287870
V/FA: App measurement setting deferred collection: false
I/oplus.android.OplusFrameworkFactoryImpl: getOplusRedPacketManager
V/FA: onActivityCreated
I/System.out: [okhttp]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out: [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
I/System.out: [socket]:check permission begin!
W/System: ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
V/FA: Checking service availability
I/System.out: [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
V/FA: Service available
V/FA: Connecting to remote service
V/FA: Detected application was in foreground
V/FA: Session started, time: 443748731
I/OplusFeatureCache: Milliseconds spent on init(): 203
I/OplusUXIconLoader: theme=2; uxIconConfig = 216807711444598786
I/OplusUXIconLoader: themeCustomPos=3;commonStylePathArray size=3
I/UXIconPaser: theme=2; pathData =M75,0 C116.421356,-7.6089797e-15 150,33.5786438 150,75 C150,116.421356 116.421356,150 75,150 C33.5786438,150 5.07265313e-15,116.421356 0,75 C-5.07265313e-15,33.5786438 33.5786438,7.6089797e-15 75,0 Z
I/OplusUXIconLoader: path = android.graphics.Path@d8bb36b; config = OplusIconConfig = [ isForeign : true,theme : 2,iconSize : 5000,iconShape : 0,foregroundSize : 6000,artPlusOn : false,shapePath ?null, nightMode : false;enableDarkModeIcon = true ]
V/OplusUXIconLoader: checkConfig sIconConfig =:OplusIconConfig = [ isForeign : true,theme : 2,iconSize : 5000,iconShape : 0,foregroundSize : 6000,artPlusOn : false,shapePath ?android.graphics.Path@4e82ec8, nightMode : false;enableDarkModeIcon = true ]
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.chattfg, PID: 22727
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.chattfg/com.example.chattfg.Register}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3735)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3903)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:255)
        at android.app.ActivityThread.main(ActivityThread.java:8212)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
     Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
        at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852)
        at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
        at com.example.chattfg.Register.onCreate(Register.java:29)
        at android.app.Activity.performCreate(Activity.java:8151)
        at android.app.Activity.performCreate(Activity.java:8135)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3704)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3903) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:255) 
        at android.app.ActivityThread.main(ActivityThread.java:8212) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049) 
V/FA: Connection attempt already in progress
I/FA: Tag Manager is not found and thus will not be used
I/Process: Sending signal. PID: 22727 SIG: 9
Disconnected from the target VM, address: 'localhost:61024', transport: 'socket'

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 victor diaz