electrode-native icon indicating copy to clipboard operation
electrode-native copied to clipboard

Needs extra environment variables to run Android on starter MiniApp.

Open AndrewSouthpaw opened this issue 4 years ago • 1 comments

Repro

  1. Ensure $ANDROID_HOME is not defined, and that Android Studio's platform-tools and tools are not in your $PATH.
  2. Generate a new mini app ern create-miniapp MyMiniApp
  3. Run ern run-android

Returns this rather unhelpful error, which suggests editing things in a gradle file (which doesn't exist for the MiniApp).

✖ An error occurred: Command failed: ./gradlew lib:uploadArchives
✖
✖ FAILURE: Build failed with an exception.
✖
✖ * What went wrong:
✖ A problem occurred configuring project ':lib'.
✖ > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable
   or by setting the sdk.dir path in your project's local properties file at ... local.properties'.
✖...

My solution was to include the following lines in my environment:

export ANDROID_HOME="/Users/$USER/Library/Android/sdk"
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools

I don't know if that's considered an "approved" method, but it gets the job done, and could help reduce friction. Would you all be amenable to changing the erroring messaging or include it somewhere in the installation readme?

AndrewSouthpaw avatar Feb 17 '20 03:02 AndrewSouthpaw

May help, similar question: https://github.com/electrode-io/movielist-miniapp/issues/26

faisalmohd83 avatar Mar 03 '21 10:03 faisalmohd83