简体   繁体   English

Android Studio SDK路径错误

[英]Android Studio SDK path error

I have been using Android Studio for the past 4 to 5 months, I think. 我认为过去4到5个月一直在使用Android Studio。 It was working fine but one day, it suddenly told me my SDK path couldn't contain a whitespace, so I removed the white space and updated my build tools. 它工作正常,但是有一天,它突然告诉我我的SDK路径不能包含空格,因此我删除了空格并更新了构建工具。 The,when I tried to open my previous projects it gave me a warning saying my Android Studio and Project point to different locations, use project SDK or Android Studio SDK. 当我尝试打开以前的项目时,它警告我说Android Studio和Project指向不同的位置,请使用项目SDK或Android Studio SDK。 Whichever option I choose, I get errors everywhere: my R is in red, I can't resolve almost the whole activity. 无论选择哪个选项,到处都会出错:我的R呈红色,几乎无法解决所有活动。 When I create a new project, everything works fine until I try to reopen it, then it gives me same build errors. 当我创建一个新项目时,一切正常,直到我尝试重新打开它,然后出现相同的构建错误。

Message Gradle Build: Message Gradle构建:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
F:\HilzClientServer\app\src\main\res\values\styles.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\Software\Softies\Androidsdk\adt-bundle-windows-x86_64-20140702\sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 4.123 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console

Download a new version of Android Studio and get all extras installed, including the SDKs you need. 下载新版本的Android Studio并安装所有其他功能,包括所需的SDK。

Having accidentally updated some new SDKs and still having old Android Studio might be an issue. 不小心更新了一些新的SDK而仍然使用旧的Android Studio可能是一个问题。

https://developer.android.com/sdk/index.html https://developer.android.com/sdk/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM