Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
670 views
in Technique[技术] by (71.8m points)

android - AndroidStudio SDK directory does not exists

I am using Android Studio for a project on SVN (usually on Windows PCs).

Lately I want to run this on a Mac, it keep giving the below error:

Error:The SDK directory '/Users/AhmadMusa/Desktop/[PROJECT PATH]/D:Androidsdk' does not exist.
Please fix the 'sdk.dir' property in the local.properties file.

I already put the SDK on local.properties file as:

sdk.dir=/Users/AhmadMusa/Library/Android/sdk

I don't know why it keep adding the (D:Androidsdk) automatically, this is my Windows PC SDK directory, but why it is here now! nothing on code mention any D:Androidsdk.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Right click your project and select 'Open Module Settings' under SDK Location put your location for your SDK.

paste in /Users/AhmadMusa/Library/Android/sdk

Clean and rebuild your project

Update

Try to delete your local.properties file and create a new one, but do not check it into version control.

Right click top level of project and Create new file 'local.properties' then add: sdk.dir=/Users/AhmadMusa/Library/Android/sdk

Clean and build


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...