Question

My Cocos2d-X game is larger than 50 Mo so as I read on the Android documentation I have to use expansion files. I followed this subject: Android OBB/ZIP loading (cocos2dx) So I modified Cocos2dxHelper.java and placed my OBB file (a renamed Zip file) on my device's sdcard: /Android/obb/com.project.id/com.project.id.obb Unfortunately my OBB file is not loaded. I added theses permissions:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Where is my mistake? Did you succeeded with loading assets from an OBB file? Is there something else to do?

Thanks in advance.

EDIT: Here is the fullpath of my OBB File: /sdcard/emulated/0/com.emedion.games.bardadum/main.1.com.emedion.games.bardadum.obb I read that "/sdcard/emulated/0/" is the correct external storage path since Android 4.2.

I'm testing it on a Nexus 4 with Android 4.4.2.

Was it helpful?

Solution

I've downloaded the latest release of Cocos2d-x (v2.2.1), made the modifications mentionned in the thread I mentionned (Android OBB/ZIP loading (cocos2dx)) and it work. I've created a new project and just zipped resources without any code modification. I think the problem was coming from compilation caching or something like that now I have to make my project working.

Thanks for your help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top