Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Android Cheat Sheet

Steve Podell edited this page Oct 1, 2017 · 16 revisions

Some Useful Articles

react-native getting-started.html

medium.com react-native-my-developer-guide-to-configure-build-and-publish-using-mac-for-android

medium.com running-react-native-app-on-the-android-emulator

So far it seems like those Facebook guys like iOS much better than Android, the tools are better for iOS and the instructions are better for iOS. And probably since all the app developer $ is in iOS, the github issues and stack overflow issues are more helpful for iOS.

So some clues...

Open Android Studio, by selecting the android dir in WeVoteReactNative.

Android Studio seems to not be useful for the JavaScript part, only for the packing, simulator launching, Java and logger viewing for the app.

Some pictures from my setup:

10/1/17 -- these images won't display until my pull request gets approved.

Issues resolved

Android Studio fails to compile the java/gradle with a “Configure Build” error

In at terminal window, make sure your ~/.bash_profile contains (substitute in your path!)

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

Then source ~/.bash_profile

A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApkCopy'

The full error is

A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not find com.github.delight-im:Android-AdvancedWebView:v3.0.0.
     Required by:
         WeVoteReactNative:app:unspecified > WeVoteReactNative:react-native-oauth:unspecified

See https://github.com/fullstackreact/react-native-oauth/blob/master/README.md#android-setup

Get a Java compile error for :react-native-oauth:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

    :react-native-oauth:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/stevepodell/WebstormProjects/WeVoteReactNative/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerPackage.java:39: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: /Users/stevepodell/WebstormProjects/WeVoteReactNative/node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerDialogFragment.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:react-native-oauth:compileReleaseJavaWithJavac FAILED

See https://github.com/fullstackreact/react-native-oauth/issues/158

Commenting the @Override in node_modules/react-native-oauth/android/src/main/java/io/fullstack/oauth/OAuthManagerPackage.java createJSModules method makes the build succeed:

// @Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

If a packaging terminal session is not automatically started by Android Studio

Do it yourself...

/usr/local/bin/node /Users/<adjust for your actual path>/NodeEnvironments/WebAppEnv/lib/node_modules/react-native-cli start

Clone this wiki locally