【问题标题】:Task :react-native-camera:compileGeneralDebugJavaWithJavac FAILED任务:react-native-camera:compileGeneralDebugJavaWithJavac FAILED
【发布时间】:2020-05-16 19:30:55
【问题描述】:

我的应用程序运行良好,但是当我尝试新安装时,它显示错误 - 任务:react-native-camera:compileGeneralDebugJavaWithJavac FAILED。下面的代码可能会帮助您解决问题。 我的 package.json 如下:

{
  "name": "app name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-community/async-storage": "^1.7.1",
    "axios": "^0.18.1",
    "native-base": "^2.13.12",
    "react": "16.8.3",
    "react-native": "^0.62.2",
    "react-native-animatable": "^1.3.2",
    "react-native-camera": "^2.11.0",
    "react-native-modalbox": "^1.7.1",
    "react-native-qrcode-scanner": "^1.2.1",
    "react-native-search-filter": "^0.1.4",
    "react-native-vector-icons": "^6.5.0",
    "react-native-webview": "5.8.1",
    "react-navigation": "^2.18.3",
    "url": "^0.11.0"
  },
  "devDependencies": {
    "@babel/core": "7.4.5",
    "@babel/runtime": "7.4.5",
    "babel-jest": "^26.0.1",
    "jest": "^26.0.1",
    "metro-react-native-babel-preset": "^0.54.1",
    "react-native-dotenv": "^0.2.0",
    "react-test-renderer": "16.8.3"
  },
  "jest": {
    "preset": "react-native"
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  }
}

android/build.gradle

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.0")
    }
}

allprojects {
    repositories {
        mavenLocal()
        google()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

我不知道这个错误。有什么帮助???

【问题讨论】:

    标签: android react-native gradle package.json


    【解决方案1】:

    我认为你有一些链接问题。

    我刚刚遇到同样的问题并在 React-Native v0.6 上解决了,这是我的解决方案:

    1. 只需关注此TUTORIAL
    2. 执行这个 `react-native run-android --no-jetifier

    `

    【讨论】:

    • 请不要只发布代码作为答案,还要解释您的代码的作用以及它如何解决问题的问题。带有解释的答案通常更有帮助,质量更高,更有可能吸引投票。
    猜你喜欢
    • 2019-08-04
    • 1970-01-01
    • 1970-01-01
    • 2022-11-12
    • 2021-09-15
    • 2023-03-16
    • 2020-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多