尝试安装react-native-google-place-picker

时间:2019-01-20 06:35:08

标签: react-native

当我尝试安装react-native-google-place-picker时,出现以下错误。请帮我纠正它。

出了什么问题:

Execution failed for task 
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\46.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\42.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\38.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\34.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\50.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\54.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\0.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\23.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\9.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\14.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\27.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\5.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\10.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\22.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\18.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\8.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\26.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\13.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\4.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\17.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\21.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\3.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\12.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\25.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\7.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\1.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\16.jar, 
D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\29.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\11.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\2.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\19.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\20.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\6.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\28.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\15.jar, D:\ReactNativeProjects\locationPicker\android\app\build\intermediates\transforms\dexBuilder\debug\24.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
36 actionable tasks: 6 executed, 30 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

1 个答案:

答案 0 :(得分:0)

尝试将其添加到您的android / app / build.gradle

defaultConfig {
 ...
 multiDexEnabled true
 ...
}

还有

android {
 ...
}

configurations.all {
  resolutionStrategy.eachDependency { DependencyResolveDetails details ->
     def requested = details.requested
     if (requested.group == 'com.android.support' && requested.name != 'multidex') {
        details.useVersion "${rootProject.ext.supportLibVersion}"
      }
   }
}

dependencies{
 ...
}