MuliDex class 无法解析
MuliDex class cannot be resolved
祝所有天才们今天愉快。我需要帮助解决我的应用程序 64k 限制。我根据 book.I 在我的应用 build.gradle 文件
中添加了这些行
defaultConfig {
applicationId "com.ihive.quintesentialtechs.activity"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true;
}
然后添加了一个multidex aar模块依赖
compile project(':multidex-1.0.1')
然后我像这样继续覆盖 attachBaseContext 方法
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
顺便说一句,我的应用程序 class 扩展了 Application 而不是 MultiDexApplication 并且在我的清单中我这样做了
<application
android:name="com.ihive.quintesentialtechs.application.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
所以问题是在我的应用程序 class 中,MultiDex class 无法解析,我尝试使缓存无效并重新启动,但没有任何效果!请有人帮助我。提前致谢。
您还应该将 compile 'com.android.support:multidex:1.0.0'
添加到 build.gradle 文件的依赖项部分。
如果添加依赖后还是报错,请尝试重启android studio,如果还是报错,删除项目的.gradle文件夹,重新build。让应用程序再次从头开始下载所有依赖项。希望这有帮助。
祝所有天才们今天愉快。我需要帮助解决我的应用程序 64k 限制。我根据 book.I 在我的应用 build.gradle 文件
中添加了这些行 defaultConfig {
applicationId "com.ihive.quintesentialtechs.activity"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true;
}
然后添加了一个multidex aar模块依赖
compile project(':multidex-1.0.1')
然后我像这样继续覆盖 attachBaseContext 方法
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
顺便说一句,我的应用程序 class 扩展了 Application 而不是 MultiDexApplication 并且在我的清单中我这样做了
<application
android:name="com.ihive.quintesentialtechs.application.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
所以问题是在我的应用程序 class 中,MultiDex class 无法解析,我尝试使缓存无效并重新启动,但没有任何效果!请有人帮助我。提前致谢。
您还应该将 compile 'com.android.support:multidex:1.0.0'
添加到 build.gradle 文件的依赖项部分。
如果添加依赖后还是报错,请尝试重启android studio,如果还是报错,删除项目的.gradle文件夹,重新build。让应用程序再次从头开始下载所有依赖项。希望这有帮助。