react-native-map 将字节码转换为 dex 时出错:WithDexForDebug

约翰

我已经失去了 2 天,我根本无法构建一个使用 react-native-map 的 react-native 项目。这是我运行时遇到的错误react-native run-android

Dex:将字节码转换为 dex 时出错:WithDexForDebug 原因:com.android.dex.DexException:多个 dex 文件定义 Lcom/google/android/gms/auth/api/signin/internal/zzg;意外的顶级异常:com.android.dex.DexException:多个 dex 文件定义了 Lcom/google/android/gms/auth/api/signin/internal/zzg;

这是我的 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"
  }
}

我已经跑了react-native rlink react-native-maps

另外,这是我的android/build.gradle文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
            //url "https://maven.google.com"
        }
    }
}

这是我的android/app/build.gradle文件

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'
}

我正在从 Windows 10 进行开发。在我的 Android Studio 中,我很确定我安装了 Google Play 服务。当我查看我的电脑硬盘时,我确实看到了 Google Play Services:10.0.1 的存在。

如何让我的项目编译以便我可以使用react-native-maps

约翰

compile 'com.google.android.gms:play-services:10.0.1'从我的android/app/build.gradle文件中删除了该行,然后一切正常。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

将字节码转换为dex时出错

来自分类Dev

错误:将字节码转换为dex时出错

来自分类Dev

将字节码转换为dex时出错:

来自分类Dev

错误:将字节码转换为 dex 时出错:领域

来自分类Dev

在真实设备中运行时将字节码转换为 dex 时出错

来自分类Dev

错误:将字节码转换为 dex 时出错:原因:com.android.dex.DexException:--main-dex-list 中的类太多,超出主 dex 容量

来自分类Dev

错误:将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Lcom/example/admin/myapplication/MainActivity;

来自分类Dev

Android studio(2016年4月28日,2.1.1)将字节码转换为dex时发生奇怪的错误。Dex无法解析版本52字节代码

来自分类Dev

Android studio(2016年4月28日,2.1.1)将字节码转换为dex时发生奇怪的错误。Dex无法解析版本52字节代码

来自分类Dev

将字节码转换为dex时出错:原因:java.lang.RuntimeException:异常解析类-Android Studio 2.0 beta 6

来自分类Dev

React Native试图将坐标传递给Polyline时出错:NSNumber无法转换为NSDictionary

来自分类Dev

注销用户时出错-转换React Native Firebase

来自分类Dev

构建播放器时出错:CommandInvokationFailure:无法将类转换为dex格式

来自分类Dev

将jar转换为dex时保留文件夹

来自分类Dev

如何使dex2jar在将dex转换为jar时跳过某些类?

来自分类Dev

如何使dex2jar在将dex转换为jar时跳过某些类?

来自分类Dev

将keras模型转换为React-Native的tfjs时更改分片大小

来自分类Dev

react-native 在显示图像时出错

来自分类Dev

React Native Android 添加包时出错

来自分类Dev

在 react native 中使用 geolib 时出错

来自分类Dev

将文本转换为QR码时出错

来自分类Dev

React-Native:将组件导入 App.js 时出错

来自分类Dev

React Native类似于React的.map吗?

来自分类Dev

在使用react-redux实现react-native时出错

来自分类Dev

将jar转换为dex时,模拟局部变量类型不匹配导致的异常

来自分类Dev

使用react native将content:// uri转换为file:// uri

来自分类Dev

逐步将React Native Javascript +流项目转换为Typescript?

来自分类Dev

无法在React Native render()中运行.map()

来自分类Dev

React Native Map (Airbnb) + Markers 动画

Related 相关文章

  1. 1

    将字节码转换为dex时出错

  2. 2

    错误:将字节码转换为dex时出错

  3. 3

    将字节码转换为dex时出错:

  4. 4

    错误:将字节码转换为 dex 时出错:领域

  5. 5

    在真实设备中运行时将字节码转换为 dex 时出错

  6. 6

    错误:将字节码转换为 dex 时出错:原因:com.android.dex.DexException:--main-dex-list 中的类太多,超出主 dex 容量

  7. 7

    错误:将字节码转换为 dex 时出错:原因:com.android.dex.DexException:多个 dex 文件定义了 Lcom/example/admin/myapplication/MainActivity;

  8. 8

    Android studio(2016年4月28日,2.1.1)将字节码转换为dex时发生奇怪的错误。Dex无法解析版本52字节代码

  9. 9

    Android studio(2016年4月28日,2.1.1)将字节码转换为dex时发生奇怪的错误。Dex无法解析版本52字节代码

  10. 10

    将字节码转换为dex时出错:原因:java.lang.RuntimeException:异常解析类-Android Studio 2.0 beta 6

  11. 11

    React Native试图将坐标传递给Polyline时出错:NSNumber无法转换为NSDictionary

  12. 12

    注销用户时出错-转换React Native Firebase

  13. 13

    构建播放器时出错:CommandInvokationFailure:无法将类转换为dex格式

  14. 14

    将jar转换为dex时保留文件夹

  15. 15

    如何使dex2jar在将dex转换为jar时跳过某些类?

  16. 16

    如何使dex2jar在将dex转换为jar时跳过某些类?

  17. 17

    将keras模型转换为React-Native的tfjs时更改分片大小

  18. 18

    react-native 在显示图像时出错

  19. 19

    React Native Android 添加包时出错

  20. 20

    在 react native 中使用 geolib 时出错

  21. 21

    将文本转换为QR码时出错

  22. 22

    React-Native:将组件导入 App.js 时出错

  23. 23

    React Native类似于React的.map吗?

  24. 24

    在使用react-redux实现react-native时出错

  25. 25

    将jar转换为dex时,模拟局部变量类型不匹配导致的异常

  26. 26

    使用react native将content:// uri转换为file:// uri

  27. 27

    逐步将React Native Javascript +流项目转换为Typescript?

  28. 28

    无法在React Native render()中运行.map()

  29. 29

    React Native Map (Airbnb) + Markers 动画

热门标签

归档