我在添加新库时在react-native上出现此错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/exoplayer2/LoadControl.class
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
我知道它为什么通过在android文件夹
中运行以下命令返回错误./gradlew app:dependencies
在不同的库下发现了多个版本的exoplayer。
我正在使用react-native-track-player
和react-native-audio-streamer
...
| \--- com.google.android.exoplayer:exoplayer:r2.1.1
...
...
| +--- com.google.android.exoplayer:exoplayer-core:r2.4.3
...
当我移除react-native-audio-streamer
并运行react-native run-android
时,它正在运行
如何更改子库版本不是该库的所有者。
答案 0 :(得分:0)
尝试
./gradlew clean
然后重新构建