越来越引起NullPointerException异常的zip扩展文件。邮编不放在模拟器的正确的目录? [英] Getting zip expansion file causing NullPointerException. Zip is not placed in right directory of emulator?

查看:325
本文介绍了越来越引起NullPointerException异常的zip扩展文件。邮编不放在模拟器的正确的目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行在eclipse模拟器的应用程序。在DDMS角度来看,文件浏览器,我已经把我的.obb文件中MNT / OBB / mypackage.name.example / main.1.mypackage.name.example.obb。现在,林在这行获得NullPointerException异常:

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?

推荐答案

该路径必须是

的Andr​​oid / OBB / com.example.android /

Android/obb/com.example.android/

其给出这里

只是存储在文件

到/ mnt / SD卡/ Android版/ OBB /

/mnt/sdcard/Android/obb/

修改

这是一个模拟器的运行截图API级别17

This is a screenshot of an emulator running API Level 17

编辑2

如果你没有SD卡内的文件夹中的Andr​​oid,只需创建一个

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

此文件夹层次结构必须存在

This folder hierarchy needs to exist

到/ mnt / SD卡/ Android版/ OBB /

/mnt/sdcard/Android/obb/

注意:这将有一个SD卡的设备/仿真器才能正常工作。在没有外部存储装置的情况下,路径是不同的(因为一个模拟的SD卡被保持)。检查<一href=\"http://stackoverflow.com/questions/19453824/where-to-i-place-the-obb-file-to-test-android-expansion-pack-files-obb-on-my-n\">here

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

这篇关于越来越引起NullPointerException异常的zip扩展文件。邮编不放在模拟器的正确的目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆