I develop Android app, which uses ciphered obb file. This obb file consists of 3 files (I created it with jobb tool). On the most devices all is ok, but on the three devices there is ERROR_COULD_NOT_MOUNT. And I don't understand how to fix it. I want to distribute app without any errors :) Please, help me to do it! :)
That I have tryed: 1) Unmount and mount obb file; 2) Create obb file from the folder without "read-only" attribute. But all of it won't work.
Steps to reproduce the problem (including sample code if appropriate). 1) Create folder, put into it 3 different files. 2) Create obb file from the folder from step 1. 3) Try to mount this file from the app (sample code below).
final File mainFile = new File(Environment.getExternalStorageDirectory() + "/Android/obb/" + packageName + "/" + "main." + versionCode + "." + packageName + ".obb"); OnObbStateChangeListener listener = new OnObbStateChangeListener() { @Override public void onObbStateChange(String path, int state) { super.onObbStateChange(path, state); if (state == OnObbStateChangeListener.MOUNTED) { doNextSteps(); } else if (state == OnObbStateChangeListener.ERROR_COULD_NOT_MOUNT) { Toast.makeText(getApplicationContext(), "ERROR_COULD_NOT_MOUNT", Toast.LENGTH_LONG).show(); } } }; if (!storageManager.isObbMounted(mainFile.getAbsolutePath())) { storageManager.unmountObb(mainFile.getAbsolutePath(), true, listener); storageManager.mountObb(mainFile.getAbsolutePath(), "password_string", listener); } else { doNextSteps(); }
What happened. I have "ERROR_COULD_NOT_MOUNT" error on the following devices: 1) HTC PJ401 One S; 2) Samsung GT-I9505 Galaxy S IV; 3) Samsung SM-N9005 Galaxy Note 3. But on Samsung SM-N900T Galaxy Note 3 and Samsung GT-I9500 Galaxy S IV all is ok.