flowkey/UIKit-cross-platform

`Error: Please select Android SDK` when running a UIKit project in Android Studio.

Closed this issue · 3 comments

janek commented

Tested on the Demo App from /samples/getting-started as well as an existing iOS project that imported UIKit.

Current behavior

When opened in Android Studio, the project doesn't run, reporting Error: Please select Android SDK (see screenshot below). This seems to be a fairly common problem in Android Studio, but common solutions I tried from StackOverflow didn't work.

Expected behavior

The sample project should build and run smoothly.

Steps to reproduce

  1. Follow the readme instructions for adding UIKit or use the Demo App
  2. Open the ./android folder of your UIKit project in Android Studio (install Android SDKs if necessary) and press "run" button

Workaround

This problem can be avoided by following these steps:

  1. Close project in Android Studio
  2. Open another project or create a new one, in order to have access to the relevant menu option
  3. Choose File -> New -> Import project... and import the UIKit project you want to run

Once that's done, the project runs fine, but doing Build -> Refresh linked C++ projects will 'break' it again and the workaround will have to be repeated.

Screenshots

screen shot 2018-07-23 at 14 25 08

Environment

  • Device: MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)
  • OS: macOS 10.13.5
  • UIKit Version:

Hi @janekszynal, just reposting a bit of what we wrote in Slack regarding this. Hopefully we can get to the bottom of it.

We also had issues with “Please select Android SDK” in testing, but were able to fix it by returning to a clean state of the UIKit repo with git clean -xdf.

Another thing to note is that there is a difference between dragging the ./android folder onto Android Studio and clicking File->Open in Android Studio. Dragging the ./android directory breaks as you describe, pressing File->Open works as expected (without the error you describe)

This isn't really an issue we can do anything about. If someone comes across this and the instructions above aren't enough to fix it let us know.

I have seen this too, but its really an Android studio bug, and it happens when using https://github.com/SwiftJava/android_toolchain (independently of this project).