V Vivek Bhatt Member Licensed User Sep 9, 2017 #1 When I run Program then it show me error. i will try to solve this error and find the tutorials or any guide but its not find. Logger connected to: emulator-5554 *** Service (starter) Create *** Error occurred on line: 25 (Starter) java.io.FileNotFoundException: /mnt/sdcard/Android/data/b4a.example/files/virtual_assets/data.db (No such file or directory) at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method) at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232) at java.io.FileInputStream.<init>(FileInputStream.java:80) at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:199) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:335) at b4a.example.starter._service_create(starter.java:178) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139) at anywheresoftware.b4a.BA.raiseEvent(BA.java:166) at b4a.example.starter.onCreate(starter.java:55) at android.app.ActivityThread.handleCreateService(ActivityThread.java:1920) at android.app.ActivityThread.access$2500(ActivityThread.java:117) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:982) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3647) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) ** Service (starter) Start **
When I run Program then it show me error. i will try to solve this error and find the tutorials or any guide but its not find. Logger connected to: emulator-5554 *** Service (starter) Create *** Error occurred on line: 25 (Starter) java.io.FileNotFoundException: /mnt/sdcard/Android/data/b4a.example/files/virtual_assets/data.db (No such file or directory) at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method) at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232) at java.io.FileInputStream.<init>(FileInputStream.java:80) at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:199) at anywheresoftware.b4a.objects.streams.File.Copy(File.java:335) at b4a.example.starter._service_create(starter.java:178) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710) at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339) at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:139) at anywheresoftware.b4a.BA.raiseEvent(BA.java:166) at b4a.example.starter.onCreate(starter.java:55) at android.app.ActivityThread.handleCreateService(ActivityThread.java:1920) at android.app.ActivityThread.access$2500(ActivityThread.java:117) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:982) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3647) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) ** Service (starter) Start **
JakeBullet70 Well-Known Member Licensed User Longtime User Sep 9, 2017 #2 It cannot find the file: data.db Is there a data.db in your files folder? If so it needs to be copied to a working folder before you open it. Upvote 0
It cannot find the file: data.db Is there a data.db in your files folder? If so it needs to be copied to a working folder before you open it.
DonManfred Expert Licensed User Longtime User Sep 9, 2017 #3 1. Post log in quote tags! 2. Hiding the code you are using does NOT HELP. Upload a small sample project which shoes the problem. 3. Use a real device instead of the Emulator. Does the emulator have an SDCard? Based on the error it can not find the file data.db inside the files folder Upvote 0
1. Post log in quote tags! 2. Hiding the code you are using does NOT HELP. Upload a small sample project which shoes the problem. 3. Use a real device instead of the Emulator. Does the emulator have an SDCard? Based on the error it can not find the file data.db inside the files folder
V Vivek Bhatt Member Licensed User Sep 9, 2017 #4 yes i wil create data.db using sql dababase Manager. Upvote 0
V Vivek Bhatt Member Licensed User Sep 9, 2017 #5 DonManfred said: 1. Post log in quote tags! 2. Hiding the code you are using does NOT HELP. Upload a small sample project which shoes the problem. 3. Use a real device instead of the Emulator. Does the emulator have an SDCard? Based on the error it can not find the file data.db inside the files folder Click to expand... Yes Sir Emulator have an SD Card. Upvote 0
DonManfred said: 1. Post log in quote tags! 2. Hiding the code you are using does NOT HELP. Upload a small sample project which shoes the problem. 3. Use a real device instead of the Emulator. Does the emulator have an SDCard? Based on the error it can not find the file data.db inside the files folder Click to expand... Yes Sir Emulator have an SD Card.
Erel B4X founder Staff member Licensed User Longtime User Sep 10, 2017 #6 Please upload the project (File - Export as zip). Upvote 0
V Vivek Bhatt Member Licensed User Sep 11, 2017 #7 Erel said: Please upload the project (File - Export as zip). Click to expand... Thank You Sir. Attachments FirstApp.zip FirstApp.zip 9.7 KB · Views: 326 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2017 #8 Code: Copy Public dbpath= "D:\B4A\Files\data.db" As String This is an invalid path. You cannot access the PC file system. You can add the database to the Files folder and then use DBUtils.CopyDBFromAssets to copy the file to a writable folder. Upvote 0
Code: Copy Public dbpath= "D:\B4A\Files\data.db" As String This is an invalid path. You cannot access the PC file system. You can add the database to the Files folder and then use DBUtils.CopyDBFromAssets to copy the file to a writable folder.
eps Expert Licensed User Longtime User Sep 11, 2017 #9 see also this thread by the same User... https://www.b4x.com/android/forum/threads/database-unable-to-open.83730/#post-530638 Upvote 0
see also this thread by the same User... https://www.b4x.com/android/forum/threads/database-unable-to-open.83730/#post-530638