Hi,
My free apk has been published to googleplaystore a few minutes ago, compiled in API29 and jdk1.8 (api target 28)
My apk works fine in my mobile and in AVD emulator, but people is trying my app downloading it from googleplay store and receive next error message:
java.io.FileNotFoundException: storage/emulated/0/Android/data/com.myapp/files/myapp.db3
Apk contains the file myapp.db3 (i've verified it twice and it's in assets (Files path)) This .db3 is required for the app works. In code, I access to it in next way (Same way as did in my old apps in API14 jdk 1.6 which worked fine):
I don't know what I'm doing wrong, this is my first app after some years and I don't know if I have to consider more points currently . Please, could someone guide me to a solution? code is working fine in my AVD in debug and release mode and in my mobile.
The issue is that people who installe the apk first in their mobiles is receiving the exception
EDIT: More info, it seems that issue is when trying to do the copy command:
My feeling is that it's not possible to copy the file from File.DirAssets to File.DirDefaultExternal and I don't know if it can be due to permissions
My free apk has been published to googleplaystore a few minutes ago, compiled in API29 and jdk1.8 (api target 28)
My apk works fine in my mobile and in AVD emulator, but people is trying my app downloading it from googleplay store and receive next error message:
java.io.FileNotFoundException: storage/emulated/0/Android/data/com.myapp/files/myapp.db3
Apk contains the file myapp.db3 (i've verified it twice and it's in assets (Files path)) This .db3 is required for the app works. In code, I access to it in next way (Same way as did in my old apps in API14 jdk 1.6 which worked fine):
B4X:
If File.Exists(File.DirDefaultExternal , "myapp.db3") = False Then
If FirstTime Then
File.Copy(File.DirAssets, "myapp.db3", File.DirDefaultExternal, "ibeCycling.db3")
SQL1.Initialize(File.DirDefaultExternal , "myapp.db3", True)
End If
Else
If FirstTime Then
SQL1.Initialize(File.DirDefaultExternal , "myapp.db3", True)
sValidacion = SQL1.ExecQuerySingleResult ("SELECT count(*) FROM Cycling")
If sValidacion = 0 Then
SQL1.Close
File.Delete(File.DirDefaultExternal, "myapp.db3")
File.Copy(File.DirAssets, "myapp.db3", File.DirDefaultExternal, "myapp.db3")
SQL1.Initialize(File.DirDefaultExternal , "myapp.db3", True)
End If
End If
End If
I don't know what I'm doing wrong, this is my first app after some years and I don't know if I have to consider more points currently . Please, could someone guide me to a solution? code is working fine in my AVD in debug and release mode and in my mobile.
The issue is that people who installe the apk first in their mobiles is receiving the exception
EDIT: More info, it seems that issue is when trying to do the copy command:
B4X:
File.Copy(File.DirAssets, "myapp.db3", File.DirDefaultExternal, "ibeCycling.db3")
My feeling is that it's not possible to copy the file from File.DirAssets to File.DirDefaultExternal and I don't know if it can be due to permissions
Last edited: