Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: Genero Mobile - App installation issue  (Read 8424 times)
Richard M.
Posts: 5


« on: April 03, 2020, 06:09:53 pm »

Hi,

There is a problem deploying an apk created on a version of GST(GMA) different to that used to create an existing apk on the device.

The Android device detects an existing app is being upgraded, but the upgrade attempt always fails.

There is not a problem upgrading apps where the apk is generated from the same GST(GMA) version.

The only workround for this is to delete the existing app on the device and do a fresh install.   

This results in the apps database being cleared.....   which is obviously not great.

The SQLite db used by the application is embedded in the app itself (as far as i can tell), so when you delete the app the DB goes as well.


We are looking for a way to retain the SQLite db on the device, regardless of whether an upgrade or reinstall of the app occurs.

Anybody any ideas?





Susobh S.
Posts: 22


« Reply #1 on: April 04, 2020, 07:17:28 pm »

Hi

Suspect the issue is because the apk gets signed using a different certificate while using the latest GMA. Open for expert advice.
BTW, have you tried updating the app using unsigned apk?

Susobh Sugathan
Reuben B.
Four Js
Posts: 1047


« Reply #2 on: April 06, 2020, 12:09:54 am »

Hi,

There is a problem deploying an apk created on a version of GST(GMA) different to that used to create an existing apk on the device.

The Android device detects an existing app is being upgraded, but the upgrade attempt always fails.

There is not a problem upgrading apps where the apk is generated from the same GST(GMA) version.

The only workround for this is to delete the existing app on the device and do a fresh install.   

This results in the apps database being cleared.....   which is obviously not great.

The SQLite db used by the application is embedded in the app itself (as far as i can tell), so when you delete the app the DB goes as well.


We are looking for a way to retain the SQLite db on the device, regardless of whether an upgrade or reinstall of the app occurs.

Anybody any ideas?


With regarding to maintaining data when you upgrade an app, pay attention to the creating first database section as described for GMA and GMI at bottom here ...
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_gma_app_structure.html
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_gmi_app_structure.html

and also covered here
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_sql_programming_059.html


If you ship a database along with your program objects, it will be placed in the area labelled 'Program Files' in the two directory structure diagrams.  When your app is first run, it needs to copy the database to the Writable app files area, so that it is not overwritten when you subsequently upgrade the app.  If your app does not ship a database but you create one on first run then again make sure you create it in the Writable app files area.  In both cases your apps need to be responsible for how the database is upgraded each time you upgrade the app, either with a new SQLite database file that you unload/load from existing to new, or by a series of ALTER TABLE to turn existing into new, and in doing so you have to consider what happens if a user skips an upgrade (fun)...

You also should consider what happens if you delete and install the app again.  All the files in the Application Sandbox will be deleted.  With Android you can write to files outside your Application SandBox eg. SD Cards, and that is perhaps one way to preserve data across the delete and reinstall of an app.  iOS does have an "Offload App" feature.

With regards your particular issue, does the app upgrade or does it perhaps fail on first run because the database is not as it thinks it is.  So first thing I'd check is the version number of the installed app.  If that has gone up, you know the install has probably finished, and the problem is when the app is run.  If the version number hasn't gone up then the problem is in the install of the upgrade, perhaps certificates as Susobh suggested.

Reuben

























Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Susobh S.
Posts: 22


« Reply #3 on: April 06, 2020, 09:56:10 am »

Hi
I have faced the same issue during our dev and beta testing of one of our app.
While we try to update the app using apk, error says ‘Update Failed’ and the app would not get updated.

The issue was the initial apk was generated and signed using a different developers machine, and the latest version apk was generated and signed using my Laptop. Causing the apk signing to be done using different keystore file.

But then we try to regenerate the latest apk using the same old developers machine, the app was able to be updated flawlessly.

So from then, we use a centralised keystore file for generating the apk and thus the signing will use the same keystore file.

A new keystore file was generated and is shared among the other developers
And all of us have been using the same keystore file in the Android configuration

Thanks and Regards
Susobh Sugathan
Richard M.
Posts: 5


« Reply #4 on: April 06, 2020, 01:32:49 pm »

Hi

Suspect the issue is because the apk gets signed using a different certificate while using the latest GMA. Open for expert advice.
BTW, have you tried updating the app using unsigned apk?

Susobh Sugathan

Hi Susobh,

I've tried using the unsigned apk but the update still fails.
Richard M.
Posts: 5


« Reply #5 on: April 06, 2020, 01:52:33 pm »

Hi
I have faced the same issue during our dev and beta testing of one of our app.
While we try to update the app using apk, error says ‘Update Failed’ and the app would not get updated.

The issue was the initial apk was generated and signed using a different developers machine, and the latest version apk was generated and signed using my Laptop. Causing the apk signing to be done using different keystore file.

But then we try to regenerate the latest apk using the same old developers machine, the app was able to be updated flawlessly.

So from then, we use a centralised keystore file for generating the apk and thus the signing will use the same keystore file.

A new keystore file was generated and is shared among the other developers
And all of us have been using the same keystore file in the Android configuration

Thanks and Regards
Susobh Sugathan

Hi Susobh,


Where is the keystore file found please?

Thanks
Richard M.
Posts: 5


« Reply #6 on: April 06, 2020, 02:38:11 pm »

Hi Susobh,

Found it in the GST config,  at $(USERPROFILE)\.android\debug.keystore

I'm going to try and copy the one on the laptop the original apk was generated to mine and try generating the apk again.....



Hi
I have faced the same issue during our dev and beta testing of one of our app.
While we try to update the app using apk, error says ‘Update Failed’ and the app would not get updated.

The issue was the initial apk was generated and signed using a different developers machine, and the latest version apk was generated and signed using my Laptop. Causing the apk signing to be done using different keystore file.

But then we try to regenerate the latest apk using the same old developers machine, the app was able to be updated flawlessly.

So from then, we use a centralised keystore file for generating the apk and thus the signing will use the same keystore file.

A new keystore file was generated and is shared among the other developers
And all of us have been using the same keystore file in the Android configuration

Thanks and Regards
Susobh Sugathan

Hi Susobh,


Where is the keystore file found please?

Thanks
Richard M.
Posts: 5


« Reply #7 on: April 06, 2020, 03:15:49 pm »


Following Susobh's suggestions i got hold of the debug.keystore file from the laptop that the apk was originaly compiled on.

I copied this to my laptop.

I then generated a new apk and installed it over the original (which was compiled using the same debug.keystore file)

The upgrade worked perfectly this time, leaving the DB intact (as it should).

Thanks Guys  :)


Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines