Open priyanga-ganapathi-zoomrx opened 3 years ago
I have the exact same debug output. The errors look scary but I think they are just debug callbacks as the plugin works out what directories need to be created on the first run to download and extract updates. As you can see the mkdir calls running after them along with a final "Package download success".
However my app crashes in the same place as yours, just after "Applying full update" with the same error:
⚡️ [log] - [CodePush] Applying full update
*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
@UserSG Did you find a resolution? @leo6104 is this something you've come across in iOS testing?
Could you please let us know, if we could help in any way? Are you guys making progress here?
@alexcroox Unfortunately, no I couldn't able to fix it and the issue still exists in both iOS and Android. @o-alexandrov No progress was made.
We have been seeing some issues where newly deployed source files cannot be loaded by the WebView after updating after a resume from suspend event. Not sure what's going on here but could be related.
[CodePush] Update is installed and will be run after the app has been in the background for at least 300 seconds.
App Paused
App Resumed
[CodePush] Checking for update.
[CodePush] App is up to date.
ERROR during Navigation:
Errored URL - /decks
Previous URL - /
ChunkLoadError: Loading chunk 90 failed.
(error: ionic://localhost/90-es2015.76ac050118f8a1dbf311.js)
It's possible that the app restart is not occurring after the update, which would be necessary to restart the WebView, but... I'm not sure.
@lincolnthree @UserSG @o-alexandrov @alexcroox
I got the same same set of messages--both couldn't find package.json and alexcroox's cannot insert nil. I ran it in Xcode and traced it up to where the plugin is trying to read the public key. If you're used to an older version of AppCenter--like I am--you might not be expecting to have to provide a private key.
This article walks you through it if you're new to doing it: https://docs.microsoft.com/en-us/appcenter/distribution/codepush/cli
Note that when you put the values into package.json, you'll have to join all the lines together using \n since json doesn't allow multiline strings.
You'll need to give the cli a path to the private key a la: appcenter codepush release -a owner/app -c www -t 1.0 --deployment-name dev -k appcenter/private.pem
“currentPackage.json”
check is just a try
/catch
call of stat
that doesn't throw afterwards. Of course this appears in the logs like a big error when it actually isn't. A fix is still required to clean up those error logs.Running into a similar issue causing an iOS crash with error libc++abi: terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object { appVersion = "2.1.0"; deploymentKey = "redacted"; lastVersionDeploymentKey = "<null>"; lastVersionLabelOrAppVersion = "<null>"; status = 0; } for key CODE_PUSH_FAILED_STATUS_REPORT_KEY'
lastVersionDeploymentKey
and lastVersionLabelOrAppVersion
are of type NSNull
, which is not a valid for NSUserDefaults
.
The crash is avoided if strings are passed for lastVersionDeploymentKey
and lastVersionLabelOrAppVersion
.
Exception occurs here: https://github.com/mapiacompany/capacitor-codepush/blob/main/ios/Plugin/CodePushReportingManager.m#L88 and is triggered on the JS side here: https://github.com/mapiacompany/capacitor-codepush/blob/main/src/codePush.ts#L150
Only occurs on first/fresh installs lastVersionDeploymentKey
and lastVersionLabelOrAppVersion
are null. You can see that they are optional values https://github.com/mapiacompany/capacitor-codepush/blob/main/src/codePush.ts#L120.
Description
I created a capacitor project, installed the plugins, and configured the deployment key. From the javascript layer, I invoked the sync() function. I'm getting the following error and the application gets crashed at the end.
Additional Information
"@capacitor-community/http": "^1.0.0-alpha.2", "@capacitor/cli": "^3.0.0-rc.0", "@capacitor/core": "^3.0.0-rc.0", "@capacitor/device": "^0.5.6", "@capacitor/dialog": "^0.4.6", "@capacitor/filesystem": "^0.5.2", "@capacitor/ios": "^3.0.0-rc.0", "@capacitor/splash-screen": "^0.3.6", "capacitor-codepush": "github:mapiacompany/capacitor-codepush"
Repository Info
https://github.com/UserSG/CodePushWithCapacitor.git