使用 buildToolsVersion 28.0.1 时,发现多个文件具有 OS 个独立路径 'lib/mips/libRSSupport.so'
More than one file was found with OS independent path 'lib/mips/libRSSupport.so' when using buildToolsVersion 28.0.1
我已将 buildToolsVersion 从 27.0.3 更新到 28.0.1。当我编译我的项目时,出现编译错误:
More than one file was found with OS independent path 'lib/mips/libRSSupport.so'
当我点击 Build->运行 build 时,我看到了这个:
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:49)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:39)
at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
...
Caused by: com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'lib/mips/libRSSupport.so'
at com.android.builder.merge.StreamMergeAlgorithms.lambda$acceptOnlyOne(StreamMergeAlgorithms.java:75)
at com.android.builder.merge.StreamMergeAlgorithms.lambda$select(StreamMergeAlgorithms.java:100)
at com.android.builder.merge.IncrementalFileMergerOutputs.create(IncrementalFileMergerOutputs.java:86)
at com.android.builder.merge.DelegateIncrementalFileMergerOutput.create(DelegateIncrementalFileMergerOutput.java:61)
如何解决这个错误?还是 Google Build Tools 的错误?
临时解决方案是将此添加到 android {}
内的 build.gradle(应用级别)
packagingOptions {
exclude "lib/mips/libRSSupport.so"
exclude "lib/mips/librsjni.so"
}
好的,所以我找到了解决方案,我已将其添加到 build.gradle(模块):
andrid{
packagingOptions {
pickFirst "**/lib/**"
}
}
我已将 buildToolsVersion 从 27.0.3 更新到 28.0.1。当我编译我的项目时,出现编译错误:
More than one file was found with OS independent path 'lib/mips/libRSSupport.so'
当我点击 Build->运行 build 时,我看到了这个:
org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
...
Caused by: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:49)
at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:39)
at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
...
Caused by: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
...
Caused by: com.android.builder.merge.DuplicateRelativeFileException: More than one file was found with OS independent path 'lib/mips/libRSSupport.so'
at com.android.builder.merge.StreamMergeAlgorithms.lambda$acceptOnlyOne(StreamMergeAlgorithms.java:75)
at com.android.builder.merge.StreamMergeAlgorithms.lambda$select(StreamMergeAlgorithms.java:100)
at com.android.builder.merge.IncrementalFileMergerOutputs.create(IncrementalFileMergerOutputs.java:86)
at com.android.builder.merge.DelegateIncrementalFileMergerOutput.create(DelegateIncrementalFileMergerOutput.java:61)
如何解决这个错误?还是 Google Build Tools 的错误?
临时解决方案是将此添加到 android {}
packagingOptions {
exclude "lib/mips/libRSSupport.so"
exclude "lib/mips/librsjni.so"
}
好的,所以我找到了解决方案,我已将其添加到 build.gradle(模块):
andrid{
packagingOptions {
pickFirst "**/lib/**"
}
}