美文网首页
Android 程序奔溃常见问题汇总

Android 程序奔溃常见问题汇总

作者: 中華田園雞 | 来源:发表于2017-05-24 16:14 被阅读0次

    一 、Unable to find explicit activity Class{xxx}

    android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.administrator.lftapp/com.example.administrator.lftapp.TestPercent}; have you declared this activity in your AndroidManifest.xml?

    出现这个问题的原因一般为Activity未在AndroidManifest.xml文件中注册 打开
    AndroidManifest.xml文件 在<application></application>中间添加

    <activity android:name=".Activity(你的Activity名字)"/>
    

    即可

    二、Unable to instantiate activity ComponentInfo{xxxxx}

    Didn't find class "com.example.administrator.lftapp.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.administrator.lftapp-1/base.apk"]
    

    完整错误信息

    05-25 01:04:52.053 4185-4185/com.example.administrator.lftapp
    E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.administrator.lftapp, PID: 4185
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.administrator.lftapp/com.example.administrator.lftapp.MainActivity}:
    java.lang.ClassNotFoundException: Didn't find class "com.example.administrator.lftapp.MainActivity"
    on path: DexPathList[[zip file "/data/app/com.example.administrator.lftapp-1/base.apk"],
    nativeLibraryDirectories=[/data/app/com.example.administrator.lftapp-1/lib/x86, /vendor/lib, /system/lib]]
    at ajava.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

    相关文章

      网友评论

          本文标题:Android 程序奔溃常见问题汇总

          本文链接:https://www.haomeiwen.com/subject/pvroxxtx.html