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

CodePush not reaching android? Bad Configuration? #790

@natdm

Description

@natdm

Not sure if my configuration is wrong or what.

React Native .42
CodePush ^1.16.1-beta

Here is my MainApplication.java:

public class MainApplication extends NavigationApplication implements ReactApplication {
    @Override
    public boolean isDebug() {
        // Make sure you are using BuildConfig from your own application
        return BuildConfig.DEBUG;
    }

    @Override
    public List<ReactPackage> createAdditionalReactPackages() {
        // Add the packages you require here.
        // No need to add RnnPackage and MainReactPackage
        return Arrays.<ReactPackage>asList(
          new CodePush("REDACTED", MainApplication.this, BuildConfig.DEBUG),
          new LockReactPackage(),
          new VectorIconsPackage()
      );
    }

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {

    @Override
    protected String getJSBundleFile() {
      return CodePush.getJSBundleFile();
    }

    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new CodePush("REDACTED", MainApplication.this, BuildConfig.DEBUG)
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

My settings.gradle contains:

include ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

My android/app/build.gradle contains at the top:

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

When I run code-push release-react bideasy_rn android -m && code-push promote bideasy_rn Staging android, it does not seem to update my application. (note: this app does not read from Production, rather ios and android so I can push separately)

I have the same application working on iOS with codePush so it's not the javascript side that's wrong, as far as I can tell. It's supposed to update on app awake, but it's not working. I'm running a release build on the emulator but it's not pulling.

Client code, for kicks:

codePush.sync({ updateDialog: false, installMode: codePush.InstallMode.IMMEDIATE });

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions