简体   繁体   English

Android 应用程序在启动时崩溃 | IntelliJ Android Studio

[英]Android App crashes on launch | IntelliJ Android Studio

I just built my app and it started crashing without errors.我刚刚构建了我的应用程序,它开始崩溃而没有错误。 I don't know why.我不知道为什么。 I just rewrite the code from my testapp because there was missing 1 library file.我只是从我的 testapp 重写代码,因为缺少 1 个库文件。

Here is my terminal :这是我的终端:

   11/23 14:14:32: Launching app
$ adb install-multiple -r -t -p com.tomsovec.smart2t C:\Users\TomKo\Desktop\SmartLock2T\app\build\intermediates\split-apk\debug\slices\slice_8.apk 
Split APKs installed in 3 s 186 ms
$ adb shell am start -n "com.tomsovec.smart2t/com.tomsovec.smart2t.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Connected to process 10196 on device Nexus_5X_API_28 [emulator-5554]
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
W/omsovec.smart2: JIT profile information will not be recorded: profile file does not exits.
I/chatty: uid=10087(com.tomsovec.smart2t) identical 10 lines
W/omsovec.smart2: JIT profile information will not be recorded: profile file does not exits.
I/InstantRun: starting instant run server: is main process
W/omsovec.smart2: Accessing hidden method Landroid/graphics/drawable/Drawable;->getOpticalInsets()Landroid/graphics/Insets; (light greylist, linking)
    Accessing hidden field Landroid/graphics/Insets;->left:I (light greylist, linking)
    Accessing hidden field Landroid/graphics/Insets;->right:I (light greylist, linking)
    Accessing hidden field Landroid/graphics/Insets;->top:I (light greylist, linking)
    Accessing hidden field Landroid/graphics/Insets;->bottom:I (light greylist, linking)
I/omsovec.smart2: Background concurrent copying GC freed 25239(6MB) AllocSpace objects, 0(0B) LOS objects, 54% free, 1291KB/2MB, paused 1.439ms total 121.585ms
W/omsovec.smart2: JNI critical lock held for 19.414ms on Thread[1,tid=10196,Runnable,Thread*=0xe30f4000,peer=0x73a08760,"main"]
W/omsovec.smart2: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/omsovec.smart2: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
W/omsovec.smart2: Accessing hidden method Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; (light greylist, linking)
W/omsovec.smart2: JNI critical lock held for 18.004ms on Thread[1,tid=10196,Runnable,Thread*=0xe30f4000,peer=0x73a08760,"main"]
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.tomsovec.smart2t, PID: 10196
    android.content.ActivityNotFoundException: Unable to find explicit activity class {com.tomsovec.smart2t/com.tomsovec.smart2t.Login}; have you declared this activity in your AndroidManifest.xml?
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2005)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673)
        at android.app.Activity.startActivityForResult(Activity.java:4586)
        at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:676)
        at android.app.Activity.startActivityForResult(Activity.java:4544)
        at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:663)
        at android.app.Activity.startActivity(Activity.java:4905)
        at android.app.Activity.startActivity(Activity.java:4873)
        at com.tomsovec.smart2t.MainActivity.onStart(MainActivity.java:36)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
        at android.app.Activity.performStart(Activity.java:7157)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/Process: Sending signal. PID: 10196 SIG: 9
Application terminated.

At the beginning it didn't crash (only sometimes when I logged in using database一开始它没有崩溃(只是有时当我使用数据库登录时

The exception is self explanatory ActivityNotFoundException异常是不言自明的ActivityNotFoundException

android.content.ActivityNotFoundException: Unable to find explicit activity class {com.tomsovec.smart2t/com.tomsovec.smart2t.Login}; 
have you declared this activity in your AndroidManifest.xml?

Unable to find explicit activity class, have you declared this activity in your AndroidManifest.xml?无法找到显式活动类,您是否在 AndroidManifest.xml 中声明了此活动?

So.所以。 Have you added this activity to your manifest?您是否将此活动添加到您的清单中?

<application
    ...
    <activity 
        android:name=".Login" >   
    </activity>  
</application>

Please check you application's manifest.xml if you have set com.tomsovec.smart2t.Login as an activity.如果您已将com.tomsovec.smart2t.Login设置为活动,请检查您的应用程序的 manifest.xml。

The crash starts when you are trying to load your application.当您尝试加载应用程序时,崩溃开始。

Hey guys its me again... It fixed it but now when i try to load GUIMain.class it just load again Login.class and put some error to Terminal 嗨,大家好,我又回来了...它修复了它,但是现在当我尝试加载GUIMain.class时,它再次加载了Login.class并向终端添加了一些错误

(Stackovewflow didnt let me put the terminal here so if you want guys some information tell me) and thanks for help (Stackovewflow没让我把终端放到这里,所以如果您想让一些人告诉我),感谢您的帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM