electrode-native
electrode-native copied to clipboard
Needs extra environment variables to run Android on starter MiniApp.
Repro
- Ensure
$ANDROID_HOME
is not defined, and that Android Studio'splatform-tools
andtools
are not in your$PATH
. - Generate a new mini app
ern create-miniapp MyMiniApp
- 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?
May help, similar question: https://github.com/electrode-io/movielist-miniapp/issues/26