1 Replies - 121 Views - Last Post: 05 July 2019 - 01:05 PM

#1 shhr3y   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-July 19

Debugging Error - "Unfortunately, App Has Stopped"

Posted 05 July 2019 - 12:58 PM

I've be currently getting the same error every single time I debug my application in the emulator on Android Studio. The error is, "Unfortunately, app has stopped." I'm not sure what is wrong at all because I've searched it up to see if anything could help but didn't work.

If you could please take a minute to look through my code and logcat to see if you can find a solution for my error. Thank you so much.


This is my MainActivity
package com.shrey.ekka;

import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView ;
import android.widget.ImageButton;

public class MainActivity extends AppCompatActivity {
    public ImageButton face1,face2,face3,face4,face5,face6;
    TextView chooseface;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        chooseface = (TextView) findViewById(R.id.faceshape);

        face1 = (ImageButton) findViewById(R.id.face1);
        face1.setonclickListener(new View.onclickListener()
        {
            @Override
            public void onclick(View view)
            {
                openface1();
            }
        });

        face2 = (ImageButton) findViewById(R.id.face2);
        face2.setonclickListener(new View.onclickListener()
        {
            @Override
            public void onclick(View view)
            {
                openface2();
            }
        });

        face3 = (ImageButton) findViewById(R.id.face3);
        face3.setonclickListener(new View.onclickListener() {
            @Override
            public void onclick(View view) {
                openface3();
            }
        });

        face4 = (ImageButton) findViewById(R.id.face4);
        face4.setonclickListener(new View.onclickListener() {
            @Override
            public void onclick(View view) {
                openface4();
            }
        });

        face5 = (ImageButton) findViewById(R.id.face5);
        face5.setonclickListener(new View.onclickListener() {
            @Override
            public void onclick(View view) {
                openface5();
            }
        });

        face6 = (ImageButton) findViewById(R.id.face6);
        face6.setonclickListener(new View.onclickListener() {
            @Override
            public void onclick(View view) {
                openface6();
            }
        });

    }

    public void openface1()
    {
        Intent face1 = new Intent(this, Face1.class);
        startActivity(face1);

    }
    public void openface2()
    {
        Intent face2 = new Intent(this, Face2.class);
        startActivity(face2);

    }
    public void openface3()
    {
        Intent face3 = new Intent(this, Face3.class);
        startActivity(face3);

    }
    public void openface4()
    {
        Intent face4 = new Intent(this, Face4.class);
        startActivity(face4);

    }
    public void openface5()
    {
        Intent face5 = new Intent(this, Face5.class);
        startActivity(face5);

    }
    public void openface6()
    {
        Intent face6 = new Intent(this, Face6.class);
        startActivity(face6);

    }
}




logicat:

07-06 01:03:33.746 4859-4859/? I/art: Not late-enabling -Xcheck:jni (already on)
07-06 01:03:33.842 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.913 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.923 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.935 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.945 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.958 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.978 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:33.999 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:34.010 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:34.027 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:34.043 4859-4859/com.shrey.ekka W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --instruction-set=x86 --instruction-set-features=smp,ssse3,-sse4.1,-sse4.2,-avx,-avx2 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=x86 --instruction-set-features=default --dex-file=/data/app/com.shrey.ekka-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/x86/[email protected]@[email protected][email protected]) because non-0 exit status
07-06 01:03:34.048 4859-4859/com.shrey.ekka W/System: ClassLoader referenced unknown path: /data/app/com.shrey.ekka-2/lib/x86
07-06 01:03:34.054 4859-4859/com.shrey.ekka I/InstantRun: starting instant run server: is main process
07-06 01:03:34.082 4859-4859/com.shrey.ekka W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.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
07-06 01:03:34.092 4859-4859/com.shrey.ekka D/AndroidRuntime: Shutting down VM


--------- beginning of crash
07-06 01:03:34.093 4859-4859/com.shrey.ekka E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.shrey.ekka, PID: 4859
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shrey.ekka/com.shrey.ekka.MainActivity}: 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:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
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:555)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.shrey.ekka.MainActivity.onCreate(MainActivity.java:16)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
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:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
07-06 01:03:36.124 4859-4859/com.shrey.ekka I/Process: Sending signal. PID: 4859 SIG: 9





Please let me know if you've found a solution because I'm completely out of ideas. Thank you very much for taking the time to look through my code and logcat. It is much appreciated!

Is This A Good Question/Topic? 0
  • +

Replies To: Debugging Error - "Unfortunately, App Has Stopped"

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15170
  • View blog
  • Posts: 60,720
  • Joined: 12-June 08

Re: Debugging Error - "Unfortunately, App Has Stopped"

Posted 05 July 2019 - 01:05 PM

This looks to be the crux of your error message.

Quote

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shrey.ekka/com.shrey.ekka.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
\

From the snippet there not sure which is causing it.. you also may way to do a 'clean project' and 'rebuild project' before running it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1