I am going through the “Getting Started” for Android and I am stuck on 6. Hello World.
I have literally been Googling things for 2 or 3 hours trying to figure this out. When I run
rake device I get this error:
ERROR! app.sdk_path should point to a valid Android SDK directory. Run 'motion android-setup' to install the latest SDK version.
Of course I have run
motion android-setup multiple times at this point and it makes no difference. A couple times I have run
rake device and got a different error:
./build/Development-27/java/com/yourcompany/hello/MainActivity.java:5: cannot access android.app.Activity bad class file: android/app/Activity.class(android/app:Activity.class) class file has wrong version 52.0, should be 50.0 Please remove or make sure it appears in the correct subdirectory of the classpath.
I am not sure what to do. Any help would be appreciated.
@jtruman What’s the output when you type
Aside: For really really fast help/trouble shooting, definitely come to the Slack channel: http://motioneers.herokuapp.com
Here’s what I get when I run that command:
ls: /Users/jtruman/.rubymotion-android?: No such file or directory
Posting here for posterity: https://stackoverflow.com/questions/13698839/android-sdk-manager-not-fetching-other-sdk-platform
Make sure you don’t have an proxies are firewalls that would restrict the downloads of SDKs.
Try using the visual SDK Manager and see if it downloads successfully from there (the
motion android-setup command just uses the cli version of SDK Manager).
If that doesn’t work, try downloading Android Studio (to see if that succeeds). We can then extract the SDKs from there.
So it turns out the solution was to get Java 1.8 installed. Once this was done,
rake emulator worked just fine. Here is a link to Java 1.8 download: https://s3.us-east-2.amazonaws.com/amirrajan/jdk8.dmg.
Thanks @amirrajan for all the help on Slack!