Comments (10)
I fixed this (#33 (comment)) problem. MR coming soon.
Thus, I can confirm that the CodePush updates do in fact stick.
from capacitor-codepush.
@Clovel thank you so much for pushing this lib forward!
from capacitor-codepush.
Ok, so I fixed it by replacing the "www/"
instances by "public/"
. This is logical as Cordova used to generate "www/"
directories (IIRC) whereas Capacitor generates "public/"
directories.
I'll submit a MR later today.
from capacitor-codepush.
I tried fixing the www
issue in various ways on my app here, but all failed. Last resort was to fork the repo, replace all instances that were accessing the www
or /www
folder with public
and the app still runs, but nothing has changed it seems.
So the issue remains: once the app is killed and restarted, we're back with the original version, not the update. It does not ask for another update then, so it's registered as properly installed, just not loaded up when the app is freshly started.
I feel like this would be a super simple fix in the right place, but I wasn't able to find it. Again, forking this repo and trying to modify the www
to public
in the iOS Plugin sources didn't seem to work for me :/
from capacitor-codepush.
We got to the point where Android Studio logs show
Sending plugin error: {"save":false,"callbackId":"55766507","pluginId":"CodePush","methodName":"preInstall","success":false,"error":{"message":"Could not get the package start page"}}
[CodePush] Preinstall failure. Could not get the package start page. StackTrace: Error: Could not get the package start page
I feel like this is directly related to the issue you are discussing. Not being able to find the start page could be caused by hardcoded paths.
FYI, I have ./android/app/src/main/assets/public
as the path for appcenter codepush release
commands too. The application runs fine, but when applying updates we get the above logs.
from capacitor-codepush.
So, @Clovel can you confirm the updates actually stick after app restarts? I thought I had fixed it on iOS by renaming www/
to public/
pretty much anywhere I could find it (manual edits, not bulk-replace) — this made the updates work (download and apply), but after app restarts, it simply featured the original version again.
from capacitor-codepush.
I confirmed it is working for Android. I'm currently battling with my Xcode installation to test this on my iPhone. I'll keep you posted.
You can take look @ my MR if you want : #35. Feedback is appreciated.
from capacitor-codepush.
So, after testing on iOS, I get an exception when (or after ?) applying the update. Here are some of the logs I got before the exception.
Logs
⚡️ [log] - [CodePush] Installing update
⚡️ To Native -> Filesystem stat 73249589
⚡️ To Native -> Http request 73249590
ERROR MESSAGE: {"errorMessage":"The file “unzipped” couldn’t be opened because there is no such file.","message":"The file “unzipped” couldn’t be opened because there is no such file."}
⚡️ [error] - {"errorMessage":"The file “unzipped” couldn’t be opened because there is no such file.","message":"The file “unzipped” couldn’t be opened because there is no such file."}
⚡️ To Native -> Filesystem mkdir 73249591
⚡️ TO JS undefined
⚡️ To Native -> Filesystem getUri 73249592
⚡️ TO JS {"uri":"file:\/\/\/var\/mobile\/Containers\/Data\/Application\/<applicationID>\/Documents\/codepush\/download\/unzipped\/"}
⚡️ To Native -> CodePush unzip 73249593
⚡️ TO JS undefined
⚡️ To Native -> Filesystem stat 73249594
ERROR MESSAGE: {"errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","message":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
⚡️ [error] - {"errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","message":"The file “hotcodepush.json” couldn’t be opened because there is no such file."}
⚡️ To Native -> Filesystem stat 73249595
ERROR MESSAGE: {"errorMessage":"The file “versions” couldn’t be opened because there is no such file.","message":"The file “versions” couldn’t be opened because there is no such file."}
⚡️ [error] - {"errorMessage":"The file “versions” couldn’t be opened because there is no such file.","message":"The file “versions” couldn’t be opened because there is no such file."}
⚡️ To Native -> Filesystem mkdir 73249596
⚡️ TO JS undefined
⚡️ To Native -> Filesystem stat 73249597
ERROR MESSAGE: {"errorMessage":"The file <versionHash> couldn’t be opened because there is no such file.","message":"The file <versionHash> couldn’t be opened because there is no such file."}
⚡️ [error] - {"errorMessage":"The file <versionHash> couldn’t be opened because there is no such file.","message":"The file <versionHash> couldn’t be opened because there is no such file."}
⚡️ To Native -> Filesystem copy 73249598
⚡️ TO JS undefined
⚡️ [log] - [CodePush] Applying full update
⚡️ To Native -> CodePush getPublicKey 73249599
2021-06-16 21:34:16.762908+0200 App[15993:5039757] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(0x195fae5b4 0x1aaa2d7a8 0x196020a80 0x19602cad8 0x195e9b360 0x195e8dc80 0x10090f160 0x100b2cd28 0x100b21c54 0x100e10064 0x100e11d90 0x100e19ea0 0x100e1acc4 0x100e27a00 0x1e19ca7a4 0x1e19d174c)
libc++abi: terminating with uncaught exception of type NSException
terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
(lldb)
from capacitor-codepush.
I strongly believe that this is caused by the getPublicKey
call that returns null
if no public key has been given.
The plugin should be compatible with no signing. The android side works like that.
@mittermayr perhaps you could try my fixes with a private/public key.
from capacitor-codepush.
Just for anyone else who finds this who already worked around the issue with a bit of scripting...
You can get appcenter to bundle things correctly by creating a temporary folder with 'www' as the "leaf node" containing the built app/index.html and assets.
This folder will now need to be called 'public'.
/temp-dir/www
-> /temp-dir/public
Then point the appcenter-cli to this folder using -c (or) --update-contents-path
.
from capacitor-codepush.
Related Issues (20)
- CodePush Error Could not get the package start page HOT 3
- app rolls back to the version before update after closed and opened again HOT 35
- Android build error: Could not get unknown property 'androidxAppCompatVersion' HOT 2
- Hello, how to push to your local server instead of AppCenter
- Integrating into a standard javascript app HOT 1
- Plugin Error
- Cordova Codepush is shutting down HOT 6
- Add additional maintainers?
- Can not use `sync` method in script HOT 7
- Cordova support is retired in App Center, will this effect the project? HOT 1
- App Center - Apache Cordova Retirement HOT 2
- Public key was provided but there is no JWT signature within app bundle to verify HOT 17
- Cordova will be retired from App Center starting April 1st 2022 HOT 2
- [NOT A ISSUE] AppCenter CodePush Backend Alternative HOT 8
- Announcing Apache Cordova Retirement HOT 6
- Cannot find module 'capacitor-codepush', webpackMissingModule
- Is this package still maintained? HOT 9
- CommonJS or AMD dependencies can cause optimization bailouts.
- Getting `Cannot perform diff-update` error for subsequent updates HOT 4
- Http plugin failed to call api to appcenter server
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capacitor-codepush.