该应用在应用开始时运行时崩溃了。我在这里提到的以下崩溃问题刚刚显示,当我在安装部件后手动将app-debug.apk
文件放入移动设备时结束了。但是,如果通过Android工作室运行应用程序,它将正常工作。没有崩溃点会指出。
还有一件事是,我在应用程序清单中添加了所有Activities
。
Android RuneTime异常:
FATAL EXCEPTION: main
Process: com.interfinet.jobtree, PID: 23960
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.interfinet.jobtree/com.interfinet.jobtree.SplashScreen}: java.lang.ClassNotFoundException: Didn't find class "com.interfinet.jobtree.SplashScreen" on path: DexPathList[[zip file "/data/app/com.interfinet.jobtree-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2250)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.access$800(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.interfinet.jobtree.SplashScreen" on path: DexPathList[[zip file "/data/app/com.interfinet.jobtree-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1089)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413)
at android.app.ActivityThread.access$800(ActivityThread.java:155)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
Suppressed: java.lang.ClassNotFoundException: com.interfinet.jobtree.SplashScreen
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
05-11 17:53:51.758 23960-23960/com.interfinet.jobtree I/Process: Sending signal. PID: 23960 SIG: 9
app.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.interfinet.jobtree"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':linkedin-sdk')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.jaredrummler:material-spinner:1.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:multidex:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.wdullaer:materialdatetimepicker:3.1.3'
compile 'at.blogc:expandabletextview:1.0.3'
}
Manifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.interfinet.jobtree">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/app_luncher_logo11"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">
<activity
android:name=".SplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".OnboardActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".CredentialActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Login"
android:windowSoftInputMode="stateHidden|adjustResize" />
</application>
</manifest>
答案 0 :(得分:1)
转到您的项目位置,搜索.iml
文件,然后删除此文件,重新启动android studio并生成.apk文件。它会正常工作。
答案 1 :(得分:0)
从gradle文件中删除multiDexEnabled true并尝试
答案 2 :(得分:0)
据我所知,您应该更改您的包名以及清单中的活动。
答案 3 :(得分:0)
在AndroidManifest.xml
中,尝试使用android:name="com.interfinet.jobtree.SplashScreen"
代替android:name=".SplashScreen"
。
<强>的AndroidManifest.xml 强>
...........
................
<activity
android:name="com.interfinet.jobtree.SplashScreen"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
...........
................
答案 4 :(得分:0)
经过一些相同问题的研究。
如果你刚刚升级了你的android工作室。
您将无法使用此选项停用 - &gt;即时运行。 (不在菜单上)
似乎有新的android studio和gradle升级,以便安装apk,你需要正确构建它。
选项1:从命令行使用gradle
./ gradlew:appName:clean ./gradlew:appName:build
选项2:来自android studio
Android Studio - &gt;构建 - &gt;构建APK(或生成叹息APK)
生成的apk可以在设备上正确安装。
注意:如果您使用此版本的android studio启动新的应用程序,您将看到当您从工作室运行时,不再生成apk。
答案 5 :(得分:0)
尝试从gradle文件中删除此行:
multiDexEnabled true