Get Android build working

This commit is contained in:
John Lyon-Smith
2018-03-31 17:58:02 -07:00
parent 06e9ec527c
commit aa622012cd
24 changed files with 531 additions and 4288 deletions

View File

@@ -1,11 +1,15 @@
package com.deightonar;
// import com.facebook.react.ReactActivity;
import com.reactnativenavigation.controllers.SplashActivity;
import com.facebook.react.ReactActivity;
public class MainActivity extends SplashActivity {
// @Override
// protected String getMainComponentName() {
// return "DeightonAR";
// }
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "DeightonAR";
}
}

View File

@@ -11,67 +11,41 @@ import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
import com.reactnativenavigation.NavigationApplication;
import com.airbnb.android.react.maps.MapsPackage;
import com.viromedia.bridge.ReactViroPackage;
public class MainApplication extends NavigationApplication {
import com.airbnb.android.react.maps.MapsPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new MapsPackage(),
new ReactViroPackage(ReactViroPackage.ViroPlatform.GVR)
new ReactViroPackage(ReactViroPackage.ViroPlatform.GVR),
new MapsPackage(),
new MainReactPackage()
);
}
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages();
}
@Override
public String getJSMainModuleName() {
protected String getJSMainModuleName() {
return "index";
}
}
};
// public class MainApplication extends Application implements ReactApplication {
//
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
// @Override
// public boolean getUseDeveloperSupport() {
// return BuildConfig.DEBUG;
// }
//
// @Override
// protected List<ReactPackage> getPackages() {
// return Arrays.<ReactPackage>asList(
// new MainReactPackage()
// );
// }
//
// @Override
// protected String getJSMainModuleName() {
// return "index";
// }
// };
//
// @Override
// public ReactNativeHost getReactNativeHost() {
// return mReactNativeHost;
// }
//
// @Override
// public void onCreate() {
// super.onCreate();
// SoLoader.init(this, /* native exopackage */ false);
// }
// }
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}