codepush android运行bug解决2020-01-2

2020-01-26  本文已影响0人  溜溜的阳光

Caused by: com.microsoft.codepush.react.CodePushNotInitializedException: A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?

修改MainApplication.java通过packages.add方法去加载插件

@Override

        protected List<ReactPackage> getPackages() {

          @SuppressWarnings("UnnecessaryLocalVariable")

          List<ReactPackage> packages = new PackageList(this).getPackages();

          // Packages that cannot be autolinked yet can be added manually here, for example:

          // packages.add(new MyReactNativePackage());

            packages.add(new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG));

          return packages;

        }

https://gitmemory.com/issue/microsoft/react-native-code-push/1708/568679611

上一篇 下一篇

猜你喜欢

热点阅读