显示 ClassNotFoundException
Showing ClassNotFoundException
我已经实现了一个在 marshmallow 版本上成功 运行 的应用程序,但是当我在 kitkat 版本上 运行 时它显示异常,即 java.lang.ClassNotFoundException。我不知道为什么在我使用最小 sdk 版本为 16 且最大为 25 时会出现此异常,请检查下图
在 Mainfest 大放异彩
<activity
android:name="com.devbhoomimedia.maangal.SplashActivity"
android:label="Maangal.com"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
gradle 文件
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.devbhoomimedia.mgltest"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile project(path: ':library')
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:recyclerview-v7:24.1.0'
compile project(':library_spinner')
}
从 gradle 个文件中删除 multiDexEnabled = true
我已经实现了一个在 marshmallow 版本上成功 运行 的应用程序,但是当我在 kitkat 版本上 运行 时它显示异常,即 java.lang.ClassNotFoundException。我不知道为什么在我使用最小 sdk 版本为 16 且最大为 25 时会出现此异常,请检查下图
在 Mainfest 大放异彩
<activity
android:name="com.devbhoomimedia.maangal.SplashActivity"
android:label="Maangal.com"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
gradle 文件
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.devbhoomimedia.mgltest"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/']
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile project(path: ':library')
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:recyclerview-v7:24.1.0'
compile project(':library_spinner')
}
从 gradle 个文件中删除 multiDexEnabled = true