无法使用Gradle构建Android应用程序,但使用sudo除外

无法使用Gradle构建Android应用程序,但使用sudo除外,第1张

概述我正在尝试使用gradle构建一个简单的'hello world'安卓应用程序.如果我发出命令它会建立好 sudo ./gradlew build --> builds fine 但没有sudo, ./gradlew build --> shows following error FAILURE: Build failed with an

我正在尝试使用gradle构建一个简单的’hello world’安卓应用程序.如果我发出命令它会建立好

sudo ./gradlew build –> builds fine

但没有sudo,

./gradlew build –> shows following error

FAILURE: Build Failed with an exception.* What went wrong:A problem occurred configuring project ':MyStudioApplication'.> Failed to notify project evaluation Listener.   > Could not resolve all dependencIEs for configuration ':MyStudioApplication:_DeBUGCompile'.      > Could not find any version that matches com.androID.support:appcompat-v7:+.        required by:            workspace:MyStudioApplication:unspecifIEd* Try:Run with --stacktrace option to get the stack trace. Run with --info or --deBUG option to get more log output.BUILD FailedTotal time: 12.621 secs

以下是我的build.gradle

buildscript {    repositorIEs {        mavenCentral()    }    dependencIEs {        classpath 'com.androID.tools.build:gradle:0.6.+'    }}apply plugin: 'androID'repositorIEs {    mavenCentral()}androID {    compileSdkVersion 19    buildToolsversion "19.0.0"    defaultConfig {        minSdkVersion 7        targetSdkVersion 19    }}dependencIEs {    compile 'com.androID.support:appcompat-v7:+'}

请帮忙最佳答案在这里黑暗中拍摄,您可能已经使用sudo运行初始gradle构建,这可能导致工件被下载并且被打包为root并且普通用户无法访问.要测试此假设,您可能需要重命名本地存储库,其中gradle下载依赖项并重新运行gradle作为标准用户. 总结

以上是内存溢出为你收集整理的无法使用Gradle构建Android应用程序,但使用sudo除外全部内容,希望文章能够帮你解决无法使用Gradle构建Android应用程序,但使用sudo除外所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1140388.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-31
下一篇2022-05-31

发表评论

登录后才能评论

评论列表(0条)

    保存