出现这个问题的原因是在Android中,Firebase下载的dex文件没有正确加载导致的。以下是解决这个问题的代码示例和方法:
dependencies {
implementation 'com.google.firebase:firebase-core:版本号'
// 其他Firebase依赖项
}
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(this);
}
}
android {
defaultConfig {
// 其他配置项
multiDexEnabled true
}
// 其他配置项
}
dependencies {
implementation 'com.android.support:multidex:版本号'
// 其他依赖项
}
这些步骤应该解决“在dex位置找不到原始dex文件”的问题。如果问题仍然存在,请尝试清除项目构建并重新构建项目。
上一篇:安卓:从代码更新应用时测量fs-verity失败,错误编号1
下一篇:安卓:错误:程序类型已经存在:android.support.v4.app.INotificationSideChannel。