2017-10-18 11 views
0

私はすでに2日間失ってしまっており、単にreact-native-mapを使用する反応ネイティブプロジェクトを構築できません。エラーがDEXするバイトコードを変換する:WithDexForDebug原因: com.android.dex.DexException:複数のDEXファイル定義 LCOM /グーグル/アンドロイド/ GMS/AUTHこれは私がreact-native run-androidreact-native-mapバイトコードをdexに変換中にエラーが発生しました:WithDexForDebug

デックスを実行したときに、私は取得エラーです/ api/signin/internal/zzg; 予期しないトップレベル例外:com.android.dex.DexException:複数のdexファイルが定義されています Lcom/google/android/gms/auth/api/signin/internal/zzg;

これは私がすでにreact-native rlink react-native-mapsを走ってきた私のpackage.jsonファイル

{ 
    "name": "hackathon", 
    "version": "0.0.1", 
    "private": true, 
    "scripts": { 
    "start": "node node_modules/react-native/local-cli/cli.js start", 
    "test": "jest" 
    }, 
    "dependencies": { 
    "react": "16.0.0-beta.5", 
    "react-native": "0.49.3", 
    "react-native-maps": "^0.17.0", 
    "react-navigation": "git+https://github.com/react-community/react-navigation.git" 
    }, 
    "devDependencies": { 
    "babel-jest": "21.2.0", 
    "babel-preset-react-native": "4.0.0", 
    "jest": "21.2.1", 
    "react-test-renderer": "16.0.0-beta.5" 
    }, 
    "jest": { 
    "preset": "react-native" 
    } 
} 

です。

はまた、ここに私のandroid/build.gradleファイル

​​

であり、これは私が私のAndroidのメーカーでのWindows 10から私の開発をやっている私の​​ファイル

apply plugin: "com.android.application" 

import com.android.build.OutputFile 

project.ext.react = [ 
    entryFile: "index.js" 
] 

apply from: "../../node_modules/react-native/react.gradle" 

def enableSeparateBuildPerCPUArchitecture = false 

def enableProguardInReleaseBuilds = false 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.hackathon" 
     minSdkVersion 16 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
     ndk { 
      abiFilters "armeabi-v7a", "x86" 
     } 
    } 
    splits { 
     abi { 
      reset() 
      enable enableSeparateBuildPerCPUArchitecture 
      universalApk false // If true, also generate a universal APK 
      include "armeabi-v7a", "x86" 
     } 
    } 
    buildTypes { 
     release { 
      minifyEnabled enableProguardInReleaseBuilds 
      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 
     } 
    } 
    // applicationVariants are e.g. debug, release 
    applicationVariants.all { variant -> 
     variant.outputs.each { output -> 
      // For each separate APK per architecture, set a unique version code as described here: 
      // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 
      def versionCodes = ["armeabi-v7a":1, "x86":2] 
      def abi = output.getFilter(OutputFile.ABI) 
      if (abi != null) { // null for the universal-debug, universal-release variants 
       output.versionCodeOverride = 
         versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 
      } 
     } 
    } 
} 

dependencies { 
    compile project(':react-native-maps') 
    compile fileTree(dir: "libs", include: ["*.jar"]) 
    compile "com.android.support:appcompat-v7:23.0.1" 
    compile "com.facebook.react:react-native:+" // From node_modules 
    compile 'com.google.android.gms:play-services:10.0.1' 
} 

// Run this once to be able to run the application with BUCK 
// puts all compile dependencies into folder libs for BUCK to use 
task copyDownloadableDepsToLibs(type: Copy) { 
    from configurations.compile 
    into 'libs' 
} 

ですが、私はかなり確信しています私はGoogle Playサービスをインストールしました。私のコンピュータのHDDを見ると、Google Playサービスの存在がわかります:10.0.1。

react-native-mapsを使用できるようにプロジェクトをコンパイルするにはどうすればよいですか?

答えて

0

私の​​ファイルからcompile 'com.google.android.gms:play-services:10.0.1'という行を削除したところ、すべてが機能しました。

+0

しかし、クラッシュするようなことはありませんでしたか?私はあなたがこの構成を必要としなかったことを意味するのですか? –

関連する問題