美文网首页
codepush android运行bug解决2020-01-2

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

作者: 溜溜的阳光 | 来源:发表于2020-01-26 16:55 被阅读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

相关文章

网友评论

      本文标题:codepush android运行bug解决2020-01-2

      本文链接:https://www.haomeiwen.com/subject/vhwjthtx.html