Getting zip expansion file causing NullPointerException. Zip is not placed in right directory of emulator?

徘徊边缘 提交于 2019-12-11 15:13:41

问题


I'm trying to run the app in the eclipse emulator. In the ddms perspective, file explorer, I've put my .obb file inside mnt/obb/mypackage.name.example/main.1.mypackage.name.example.obb. Now Im getting NullPointerException at this line:

zip = APKExpansionSupport.getAPKExpansionZipFile(ctx,1, -1);

What could be the problem?


回答1:


The path needs to be

Android/obb/com.example.android/

Its given here

Just store the file in

/mnt/sdcard/Android/obb/

EDIT

This is a screenshot of an emulator running API Level 17

EDIT 2

In case you don't have an Android folder inside the sdcard, just create one

This folder hierarchy needs to exist

/mnt/sdcard/Android/obb/

NOTE: This will work only on devices/emulators having an sdcard. In case of a device without external storage, the path is different (since an emulated sdcard is maintained). Check here



来源:https://stackoverflow.com/questions/22281178/getting-zip-expansion-file-causing-nullpointerexception-zip-is-not-placed-in-ri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!