{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/1405","repository_url":"https://api.github.com/repos/Microsoft/react-native-code-push","labels_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/1405/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/1405/comments","events_url":"https://api.github.com/repos/Microsoft/react-native-code-push/issues/1405/events","html_url":"https://github.com/Microsoft/react-native-code-push/issues/1405","id":360585495,"node_id":"MDU6SXNzdWUzNjA1ODU0OTU=","number":1405,"title":"[Android] \"Error! Public key was provided...\" at first, then update succeeds but no change from background. New bundle installed on restart despite setting CheckFrequency.ON_APP_RESUME","user":{"login":"DavideValdo","id":26572302,"node_id":"MDQ6VXNlcjI2NTcyMzAy","avatar_url":"https://avatars1.githubusercontent.com/u/26572302?v=4","gravatar_id":"","url":"https://api.github.com/users/DavideValdo","html_url":"https://github.com/DavideValdo","followers_url":"https://api.github.com/users/DavideValdo/followers","following_url":"https://api.github.com/users/DavideValdo/following{/other_user}","gists_url":"https://api.github.com/users/DavideValdo/gists{/gist_id}","starred_url":"https://api.github.com/users/DavideValdo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavideValdo/subscriptions","organizations_url":"https://api.github.com/users/DavideValdo/orgs","repos_url":"https://api.github.com/users/DavideValdo/repos","events_url":"https://api.github.com/users/DavideValdo/events{/privacy}","received_events_url":"https://api.github.com/users/DavideValdo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-15T23:35:40Z","updated_at":"2018-09-15T23:35:40Z","closed_at":null,"author_association":"NONE","body":"### Expected Behavior\r\nApp updates on resume \r\n\r\n### Actual Behavior\r\nApp updates on restart, seeing strange things in logcat\r\n\r\n### Command used\r\n```\r\nappcenter codepush release-react -d Staging -k ./private.pem\r\n\r\n### \"[CodePush] Applying full update\" two times upon resume from background\r\n```\r\n09-15 23:33:33.940 18405 18459 D ReactNative: [CodePush] Applying full update.\r\n09-15 23:33:33.940 18405 18459 E ReactNative: [CodePush] Exception\r\n09-15 23:33:33.940 18405 18459 E ReactNative: com.microsoft.codepush.react.CodePushInvalidUpdateException: Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen: \r\n09-15 23:33:33.940 18405 18459 E ReactNative: 1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.\r\n09-15 23:33:33.940 18405 18459 E ReactNative: 2. You've been released CodePush bundle update without providing --privateKeyPath option.\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat com.microsoft.codepush.react.CodePushUpdateManager.downloadPackage(CodePushUpdateManager.java:264)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:216)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:210)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat android.os.AsyncTask$2.call(AsyncTask.java:305)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat java.util.concurrent.FutureTask.run(FutureTask.java:237)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)\r\n09-15 23:33:33.940 18405 18459 E ReactNative: \tat java.lang.Thread.run(Thread.java:760)\r\n\r\n[...] \r\n\r\n09-15 23:58:49.558 18405 19903 D ReactNative: [CodePush] The update contents succeeded the code signing check.\r\n09-15 23:58:49.566 18405 18491 I ReactNativeJS: [CodePush] Installing update.\r\n09-15 23:58:49.587 18405 18491 I ReactNativeJS: [CodePush] Update is installed and will be run on the next app restart.\r\n\r\n```\r\n\r\n(Also logcat on app restarts shows many \"Downloading package\"?)\r\n\r\n### EntryPoint.js\r\n\r\nclass EntryPoint extends React.Component {\r\n    render () {\r\n        return (\r\n            <Provider store={store}>\r\n                <MenuProvider>\r\n                    <App />\r\n                </MenuProvider>\r\n            </Provider>\r\n        )\r\n    }\r\n}\r\n\r\nexport default codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME })(EntryPoint)\r\n\r\n### MainApplication.java\r\n```\r\npublic class MainApplication extends Application implements ReactApplication {\r\n  private static CallbackManager mCallbackManager = CallbackManager.Factory.create();\r\n\r\n  public class MyReactNativeHost extends ReactNativeHost implements ReactInstanceHolder {\r\n      MyReactNativeHost (Application application) {\r\n        super(application);\r\n      }\r\n\r\n      @Override\r\n      protected String getJSBundleFile() {\r\n          return CodePush.getJSBundleFile();\r\n      }\r\n\r\n      @Override\r\n      public boolean getUseDeveloperSupport() {\r\n        return BuildConfig.DEBUG;\r\n      }\r\n\r\n      @Override\r\n      protected List<ReactPackage> getPackages() {\r\n        return Arrays.<ReactPackage>asList(\r\n          new MainReactPackage(),\r\n          new PickerPackage(),\r\n          new FBSDKPackage(mCallbackManager),\r\n          new ActionSheetPackage(),\r\n          new RNFirebasePackage(),\r\n          new RNFirebaseDatabasePackage(),\r\n          new RNFirebaseAuthPackage(),\r\n          new RNFirebaseFirestorePackage(),\r\n          new RNFirebaseStoragePackage(),\r\n          new RNFirebaseMessagingPackage(),\r\n          new RNFirebaseAnalyticsPackage(),\r\n          new RNFirebaseLinksPackage(),\r\n          new CodePush(BuildConfig.CODEPUSH_KEY, MainApplication.this, BuildConfig.DEBUG, R.string.CodePushPublicKey)\r\n        );\r\n      }\r\n\r\n      @Override\r\n      protected String getJSMainModuleName() {\r\n        return \"index\";\r\n      }\r\n  }\r\n\r\n  protected static CallbackManager getCallbackManager() {\r\n    return mCallbackManager;\r\n  }\r\n\r\n/*\r\n  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\r\n   \r\n  }; */\r\n\r\n  private final MyReactNativeHost mReactNativeHost = new MyReactNativeHost(this);\r\n\r\n  @Override\r\n  public ReactNativeHost getReactNativeHost() {\r\n    return mReactNativeHost;\r\n  }\r\n\r\n  @Override\r\n  public void onCreate() {\r\n    CodePush.setReactInstanceHolder(mReactNativeHost);\r\n    super.onCreate();\r\n    SoLoader.init(this, /* native exopackage */ false);\r\n  }\r\n}\r\n```\r\n### EntryPoint.js\r\n\r\n```\r\nclass EntryPoint extends React.Component {\r\n    render () {\r\n        return (\r\n            <Provider store={store}>\r\n                <MenuProvider>\r\n                    <App />\r\n                </MenuProvider>\r\n            </Provider>\r\n        )\r\n    }\r\n}\r\n\r\nexport default codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME })(EntryPoint)\r\n```"}}
{"actor":{"display_login":"DavideValdo"}}