ionic-team / ionic-storage

Ionic Storage module for Ionic apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to Store data in ANDROID 11 (API 30)

GopalGaikwad opened this issue · comments

Values not store in android 11 i.e API 30 ,
from below android 30 all work good. It not store any value in ionic/storage ,
Is there any new update or any new configuration for android 11 in ionic 4

Thank you...!!

Pensé que solo me pasaba en los celulares XIOAMI pero al estar investigando solo pasa en EL API 30
Igual estoy esperando una actualización

I'm seeing this too. It works on previous versions of API (29 specifically)

Yesterday got same issue. Storage doesn't work for Android 11, Galaxy A32 5.

I'm also getting the same issue! My app is not working properly in some Android 11 devices. I've tested on Samsung s20 fe and Samsung Tab A7. However, I was able to run the app without problems on Android Emulator and also in some other devices with Android 11. It looks like this problem doesn't happen to all Android 11 devices.

To solve this, we have changed our Ionic storage to use IndexDB rather than SQLite. In Angular, we change the root instantiation to this:

IonicStorageModule.forRoot({
      driverOrder: ['indexeddb', 'sqlite', 'websql']
    }),

Same problem here, Android Version 11 - API (30)

12-14 22:45:36.901 E/SQLitePlugin(17734): unexpected error, stopping db thread
12-14 22:45:36.901 E/SQLitePlugin(17734): java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String io.liteglue.SQLDatabaseHandle.getLastErrorMessage()' on a null object reference
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.liteglue.SQLiteGlueConnection.<init>(SQLiteGlueConnection.java:12)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.liteglue.SQLiteConnector.newSQLiteConnection(SQLiteConnector.java:20)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.sqlc.SQLiteConnectorDatabase.open(SQLiteConnectorDatabase.java:55)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.sqlc.SQLitePlugin.openDatabase(SQLitePlugin.java:213)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.sqlc.SQLitePlugin.access$000(SQLitePlugin.java:28)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at io.sqlc.SQLitePlugin$DBRunner.run(SQLitePlugin.java:328)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
12-14 22:45:36.901 E/SQLitePlugin(17734): 	at java.lang.Thread.run(Thread.java:923)

@oneserve solution worked for as a workaround.

Is there any idea when this bug will be addressed?

@andrepaulo, It looks like this problem is actually on cordova-sqlite-storage plugin, as can be seen here storesafe/cordova-sqlite-storage#954.

I was able to fix this problem by updating the cordova-sqlite-storage to version 6.0.0. The following steps worked for me:

(1) Delete node_modules directory
(2) Change the cordova-sqlite-storage plugin version to 6.0.0 In package.json

"cordova-sqlite-storage": "^6.0.0",

(3) Run npm install

In the case you need to test your application in a variety of devices, the site www.browserstack.com can help you. They provide many virtual devices that are ready to run your application. It helped me a lot to reproduce this bug and confirm the solution.

I don't no what is happen but i tried with this solutions and it works .
.
Remove the dependencies and install it again. This helps mi to resolve this issue

commented

This solved the issue for me (Ionic 5, Angular 11, Capacitor 3, ionic-native/sqlite 5.36, cordova-sqlite-storage: 6.0.0):

$ npm install cordova-sqlite-storage
$ npm install @awesome-cordova-plugins/sqlite
$ ionic cap sync

Hope it helps.

Pensé que solo me pasaba en los celulares XIOAMI pero al estar investigando solo pasa en EL API 30 Igual estoy esperando una actualización

Hola, lograste alguna solución ?

commented

Pensé que solo me pasaba en los celulares XIOAMI pero al estar investigando solo pasa en EL API 30 Igual estoy esperando una actualización

Hola, lograste alguna solución ?

Hola, yo lo solucioné desinstalando lo que tenía de SQLite e instalando:

$ npm install cordova-sqlite-storage
$ npm install @awesome-cordova-plugins/sqlite
$ ionic cap sync

Es lo que pone la documentación actualizada de capacitor. Seguramente tengas que cambiar cosas del código. Ánimo.

https://ionicframework.com/docs/native/sqlite