2

I have a problem with Nuxus 10 with normal user when they install my app and after run....and then it shown error

java.lang.Error: Error copying database => java.io.FileNotFoundException: /data/data/packagename/databases/databasename.sqlite: open failed: ENOENT (No such file or directory)

If I run with Nexus 10 with admin user, it works well.

AndroidManifest :

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.CALL_PHONE" />

<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_TASKS" />

I try to find the solution many times, but I still not found it.

Could you tell me the solution. Thanks,

sonida
  • 4,411
  • 1
  • 38
  • 40

1 Answers1

0

With the informations you provice I can just tell you that the database file seems not be existing. Check it with something like this:

if(new File("/path/to/database").exists()) {
    // database access code comes here
} else {
    // database does not exists. Create it!
    // create directories if needed
    // and so on
}
rekire
  • 47,260
  • 30
  • 167
  • 264
  • Now I can create database but I don't have permission to open database with normal user on Nexus 10 (Nuxus 10 run on multi-user). but when I run on this device with admin user, it works well. – sonida Apr 23 '13 at 10:50
  • In that case you may need to put your database file in a shared directory. E.g. somewhere on the sdcard. – rekire Apr 23 '13 at 10:52
  • Just another idea use the path given by the os, so the users would have their own database. If i guess right than there are fore every user other data directories which are bot accessable by other users. – rekire Apr 23 '13 at 14:16