FPTECHS044s-MacBook-Pro:android prabhudas $ ./gradlew build --refresh-dependencies 启动Gradle守护进程,1个不兼容的守护进程和1个已停止的守护进程无法重用,请使用--status获取详细信息
失败:构建失败,并出现异常。
出了什么问题: 配置项目':react-native-share'时发生问题。
无法解析配置':react-native-share:classpath'的所有工件。 找不到lint-gradle-api.jar(com.android.tools.lint:lint-gradle-api:26.1.2)。 在以下位置搜索: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar 无法下载protos.jar(com.android.tools.analytics-library:protos:26.1.2) 无法获取资源“ https://maven.google.com/com/android/tools/analytics-library/protos/26.1.2/protos-26.1.2.jar”。 无法HEAD'https://maven.google.com/com/android/tools/analytics-library/protos/26.1.2/protos-26.1.2.jar'。从服务器收到状态代码502:错误的网关
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。
在1m 11s内失败
repositories {
// google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven { url 'https://maven.fabric.io/public' }
}
allprojects {
repositories {
// google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
/*maven {
url "https://jitpack.io"
}*/
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
// url "/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/react-native/android"
url "$rootDir/../node_modules/react-native/android"
}
/*maven {
url 'https://maven.google.com'
}*/
}
}
每次我运行 sudo react-native run-android
/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/mkdirp/index.js:90
throw err0;
^
Error: EACCES: permission denied, mkdir '/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/react-native/node_modules/.cache'
at Object.mkdirSync (fs.js:776:3)
at sync (/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/mkdirp/index.js:71:13)
at sync (/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/mkdirp/index.js:77:24)
at sync (/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/mkdirp/index.js:77:24)
at save (/Users/prabhudas/StudioProjects/TilaWithReactJS/node_modules/@babel/register/lib/cache.js:50:20)
at internalTickCallback (internal/process/next_tick.js:70:11)
at process._tickCallback (internal/process/next_tick.js:47:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:778:11)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
Process terminated. Press <enter> to close the window
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
答案 0 :(得分:0)
执行此命令可能对您有帮助(尝试!):
Step 1: npm uninstall react-native-share --save-dev
Step 2: npm install --save react-native-share
Step 3: npm link
Step 4: npm link react-native-share
Step 5: Killall node -9
Step 6: react-native run-android