今天我运行我的Android RN项目时,出现了以下错误:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel$Stub
我认为要解决这个问题,必须迁移到AndroidX。
我备份了我的项目并尝试在Android Studio中进行迁移,但没有成功。我也尝试在gradle.properties
文件中手动设置。
android.enableJetifier=true
android.useAndroidX=true
在此之后,我尝试从我的app/build.gradle中删除支持的库,并将目标
targetSdkVersion
设置为28。这些尝试导致了更多错误,尤其是这一个:
Execution failed for task ':react-native-navigation:compileReactNative57_5DebugJavaWithJavac'.
我正在使用React Native 0.58.6与Wix Navigation V2。
非常感谢您的帮助。