Giter VIP home page Giter VIP logo

Comments (10)

Clovel avatar Clovel commented on September 17, 2024 7

I fixed this (#33 (comment)) problem. MR coming soon.

Thus, I can confirm that the CodePush updates do in fact stick.

from capacitor-codepush.

alexcroox avatar alexcroox commented on September 17, 2024 4

@Clovel thank you so much for pushing this lib forward!

from capacitor-codepush.

Clovel avatar Clovel commented on September 17, 2024 1

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.

mittermayr avatar mittermayr commented on September 17, 2024

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.

Clovel avatar Clovel commented on September 17, 2024

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.

mittermayr avatar mittermayr commented on September 17, 2024

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.

Clovel avatar Clovel commented on September 17, 2024

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.

Clovel avatar Clovel commented on September 17, 2024

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.

Clovel avatar Clovel commented on September 17, 2024

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.

lincolnthree avatar lincolnthree commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.