Closed creative-git closed 6 years ago
By using react-native-navigation
, we have to rewrite MainApplication.java and MainActivity.java,
That why react-native link
doesn't work on Android
.
You have to integrate manually by put your Native Package right here: https://github.com/agiletechvn/react-native-starter-kit/blob/master/android/app/src/main/java/com/reactnativestarterkit/MainApplication.java#L27
perfect
Thanks for this kit, we used on an old app and now we need to add some packages, but when i link new packages, using "react-native link" the files are added to the commented section in
` package com.example;
import android.support.annotation.Nullable; import com.reactnativenavigation.NavigationApplication;
import com.RNFetchBlob.RNFetchBlobPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.geektime.rnonesignalandroid.ReactNativeOneSignalPackage; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader;
import java.util.Arrays; import java.util.List;
public class MainApplication extends NavigationApplication { @Override public boolean isDebug() { return BuildConfig.DEBUG; }
@Nullable @Override public List createAdditionalReactPackages() {
return Arrays.asList(
new VectorIconsPackage(),
new RNFetchBlobPackage(),
new ReactNativeOneSignalPackage()
);
}
@Override public void onCreate() { super.onCreate(); SoLoader.init(this, / native exopackage / false); } }
// public class MainApplication extends Application implements ReactApplication {
// private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { // @Override // public boolean getUseDeveloperSupport() { // return BuildConfig.DEBUG; // }
// @Override // protected List getPackages() {
// return Arrays.asList(
// new MainReactPackage(),
// new RNFetchBlobPackage(),
// new VectorIconsPackage(),
new RNSoundPackage(),
new ImagePickerPackage(),
new ReactNativeRestartPackage()
// new ReactNativeOneSignalPackage(),
// new NavigationReactPackage()
// );
// }
// };
// @Override // public ReactNativeHost getReactNativeHost() { // return mReactNativeHost; // }
// @Override // public void onCreate() { // super.onCreate(); // SoLoader.init(this, / native exopackage / false); // } // } `
so how to add new packages and link them ?