0

Now that Android Q has a lot of behavioral changes in storage and data access of a file. My application can no longer be able to do these stuffs hence keeps my application crashing with multiple errors. As soon as a user clicks a button to receive a verification code the app crashes. The log file shows that it failed to make a directory in the internal storage. Hence mkdir failed to be executed.

W/ContextImpl: Failed to ensure /data/user/0/com.fole_Studios.sup/databases: mkdir failed: EACCES (Permission denied)

Hence, leads to the follwing error:

E/SQLiteLog: (14) cannot open file at line 38094 of [68b898381a]
    (14) os_unix.c:38094: (13) lstat(/data/user/0/com.fole_Studios.sup/databases/firestore.%5BDEFAULT%5D.supp-3924e.%28default%29) - 
    (1) Process ole_Studios.sup : Pid (836) Uid (10361) Euid (10361) Gid (10361) Egid (10361)
E/SQLiteDatabase: Failed to open database '/data/user/0/com.fole_Studios.sup/databases/firestore.%5BDEFAULT%5D.supp-3924e.%28default%29'.

I referred to multiple answers in Stack overflow but non helped. Most of the questions end up with the use of Legacy storage in AndroidManifest.xml

android:requestLegacyExternalStorage="true"

I did the same but no success at all.

Edited

Another error:

 java.lang.RuntimeException: Internal error in Cloud Firestore (22.0.0).

The error shows that it is caused by the following:

Caused by: java.lang.RuntimeException: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1806 SQLITE_CANTOPEN_EACCES[1806]): Could not open database
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:325)
        at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$$Lambda$2.run(Unknown Source:4)

Also,

Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1806 SQLITE_CANTOPEN_EACCES[1806]): Could not open database
        at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
        at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:300)

It seems the error occurs whenever I try to access the firestore database. I have tried to access different data from firestore but my app keeps on crashing.

The code below leads to the above errors:

_firestore.collection(USERS).whereEqualTo("phone_number", _phoneCheck).get();
4xMafole
  • 479
  • 1
  • 8
  • 20
  • What is the code the produces that error? – Alex Mamo Feb 21 '21 at 09:11
  • @AlexMamo, I have edited the question added more information and the code which causes the error. I have tried also to access the firestore database but seems I cannot and produces the same error above. – 4xMafole Feb 22 '21 at 14:00
  • Are you sure you have the right permissions in your Android Manifest file? – Alex Mamo Feb 22 '21 at 15:43
  • Yes, I am. I have added both read and write to external storage. Also I have included to use legacy external storage. – 4xMafole Feb 22 '21 at 15:54
  • 1
    This answer solved my problem. https://stackoverflow.com/a/33288986/9942927 – 4xMafole Feb 22 '21 at 16:57

0 Answers0