我的APP运行正常,但在尝试新安装时显示错误-任务: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"
}
}
}
我对此错误一无所知。有帮助吗?
答案 0 :(得分:0)
我认为您存在一些链接问题。
我只是遇到了同样的问题,并在React-Native v0.6上解决了它,这是我的解决方案:
`