Last active
June 6, 2017 23:54
-
-
Save matthewshirley/6fda47854538febf8d12f7dd16250b2f to your computer and use it in GitHub Desktop.
React Native Navigation - Android Installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. | |
android { | |
// Change these two lines | |
compileSdkVersion 25 | |
buildToolsVersion "25.0.1" | |
// ... | |
} | |
// ... | |
dependencies { | |
compile fileTree(dir: "libs", include: ["*.jar"]) | |
compile "com.android.support:appcompat-v7:23.0.1" | |
compile "com.facebook.react:react-native:+" | |
// Add this line | |
compile project(':react-native-navigation') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourpackagename; // Make sure to change this to your package | |
import com.reactnativenavigation.controllers.SplashActivity; | |
public class MainActivity extends SplashActivity { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourpackagename; | |
import android.app.Application; | |
import com.facebook.react.ReactNativeHost; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.shell.MainReactPackage; | |
import com.facebook.soloader.SoLoader; | |
import com.reactnativenavigation.NavigationApplication; | |
import java.util.Arrays; | |
import java.util.List; | |
public class MainApplication extends NavigationApplication { | |
@Override | |
public boolean isDebug() { | |
// Make sure you are using BuildConfig from your own application | |
return BuildConfig.DEBUG; | |
} | |
protected List<ReactPackage> getPackages() { | |
// Add additional packages you require here | |
// No need to add RnnPackage and MainReactPackage | |
return Arrays.<ReactPackage>asList( | |
// You can still add third party libs here | |
); | |
} | |
@Override | |
public List<ReactPackage> createAdditionalReactPackages() { | |
return getPackages(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
// Add this at the bottom of the file | |
include ':react-native-navigation' | |
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment