Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Store data in ANDROID 11 (API 30) #244

Closed
GopalGaikwad opened this issue Nov 18, 2021 · 11 comments
Closed

Unable to Store data in ANDROID 11 (API 30) #244

GopalGaikwad opened this issue Nov 18, 2021 · 11 comments

Comments

@GopalGaikwad
Copy link

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...!!

@dgomezgh
Copy link

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

@oneserve
Copy link

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

@AlexanderTkachuk
Copy link

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

@esdrasvitorsi
Copy link

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.

@oneserve
Copy link

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']
    }),

@andrepaulo
Copy link

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?

@esdrasvitorsi
Copy link

esdrasvitorsi commented Dec 15, 2021

@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.

@GopalGaikwad
Copy link
Author

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

@Anexo
Copy link

Anexo commented Feb 3, 2022

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.

@george19gt
Copy link

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 ?

@Anexo
Copy link

Anexo commented Mar 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants