Skip to content

Commit

Permalink
Fix can't run to android
Browse files Browse the repository at this point in the history
  • Loading branch information
giantss committed Oct 13, 2018
1 parent 3715ba9 commit b3d8622
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 47 deletions.
9 changes: 5 additions & 4 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
compileSdkVersion 27
buildToolsVersion '27.0.3'

defaultConfig {
applicationId "com.reduxforreactnativedemo"
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
Expand Down Expand Up @@ -138,7 +138,8 @@ android {

dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile 'com.android.support:design:27.1.1'
compile "com.android.support:appcompat-v7:27.1.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-navigation')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
package com.reduxforreactnativedemo;

import com.facebook.react.ReactActivity;
import com.reactnativenavigation.controllers.SplashActivity;

public class MainActivity extends SplashActivity {

/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "ReduxForReactNativeDemo";
}
}
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
package com.reduxforreactnativedemo;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.reactnativenavigation.NavigationReactPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;
import com.reactnativenavigation.NavigationApplication;

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(
new MainReactPackage(),
new NavigationReactPackage()
);
}

@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages();
}

@Override
public String getJSMainModuleName() {
return "index";
}
}
public class MainApplication extends NavigationApplication {
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}


@Override
public List<ReactPackage> createAdditionalReactPackages() {
return Arrays.<ReactPackage>asList(
//
);
}

@Override
public String getJSMainModuleName() {
return "index";
}
}


14 changes: 14 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@ allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url 'https://maven.google.com'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}

subprojects {
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
}
}
}
}

0 comments on commit b3d8622

Please sign in to comment.