简体   繁体   中英

Android Studio SDK path error

I have been using Android Studio for the past 4 to 5 months, I think. 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. 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. Whichever option I choose, I get errors everywhere: my R is in red, I can't resolve almost the whole activity. 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:

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.

Having accidentally updated some new SDKs and still having old Android Studio might be an issue.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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