2

So I have started developing for Bump, and in their short-sightedness they don't support x86 based Android devices/emulators. Only ARM.

Well, setting the small market aside, it's a big problem for me since I thoroughly enjoy developing using the x86 based emulator for performance reasons.

So, (since Bump is pointless on an emulator anyway) how can I disable the loading of the Bump libraries when running in the emulator?

import com.bump.api.IBumpAPI;
import com.bump.api.BumpAPIIntents;

Error:

08-06 17:58:30.895: E/AndroidRuntime(1799): java.lang.UnsatisfiedLinkError: Couldn't load android-api from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.xxxxxxxx-2.apk,libraryPath=/data/app-lib/com.xxxxxxxxx-2]: findLibrary returned null 08-06 17:58:30.895: E/AndroidRuntime(1799): at java.lang.Runtime.loadLibrary(Runtime.java:365) 08-06 17:58:30.895: E/AndroidRuntime(1799): at java.lang.System.loadLibrary(System.java:535) 08-06 17:58:30.895: E/AndroidRuntime(1799): at com.bump.api.BumpAPI.(BumpAPI.java:122) 08-06 17:58:30.895: E/AndroidRuntime(1799): at java.lang.Class.newInstanceImpl(Native Method) 08-06 17:58:30.895: E/AndroidRuntime(1799): at java.lang.Class.newInstance(Class.java:1319)

4

3 回答 3

0

唯一的方法是在模拟器上运行时从您的应用程序中临时删除 Bump 库和 Bump 相关代码,或者制作一个已删除 Bump 的重复应用程序(特别是在 x86 上运行)。即使您能够禁用凹凸库,android 仍然会尝试执行使用这些库的任何代码,例如import com.bump.api.IBumpAPI;无论如何都会导致崩溃 =(

于 2013-08-11T08:32:37.623 回答
0

为什么不使用 JNI 在 C 中创建一个自定义库,以满足链接依赖性,并在您的项目中使用它以模拟器为目标?

它类似于创建伪包装器或填充程序 - 例如:Java 中的一个函数被调用fooBar,该函数由面向 ARM 的真实库使用,它可能有参数等并返回一些东西。在伪人工库中fooBar,使用相同的参数创建一个,并返回零或虚拟对象,以模拟器为目标。

考虑到 API 和参数、函数名称等,这听起来可能非常尴尬,这是我的头等大事。请注意,通过这条路线,任务将取决于 Bump 库使用和管理的 API 有多大,我说的是本机.so编译的 ARM 版本。

于 2013-08-17T12:36:45.327 回答
0

While somewhat complex, you can achieve this by splitting your project up into several related projects using an android library project. Currently you probably have something like this

  1. Main project - Includes all code, bump libraries, etc. This is what you run on devices

You will need to split your app into 3 seperate projects:

  1. Library project - This will includes almost all the code in the original main project, with the exception of the bump library and related code.

  2. Device project - This will depend on the library project and adds the bump library and related activities. This is what you run on devices.

  3. Emulator project - This will depend on the library project. The bump library and activities are not included. This is what you run in the emulator.

The theory is the same as having a paid and a free version of your app. Except instead of paid and free, you have bump and non-bump.

于 2013-08-14T12:34:13.173 回答