如何在Android Studio中添加libandenginephysicsbox2dextension.so文件.引擎 [英] How to add the libandenginephysicsbox2dextension.so file in Android Studio | Andengine

查看:123
本文介绍了如何在Android Studio中添加libandenginephysicsbox2dextension.so文件.引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Andengine使用Android Studio开发应用程序.在导入andengine.jar和libandenginephysicsbox2dextension.jar之后,一切似乎都能正常工作.在创建PhysicsWorld的位置:

I wanted to develop an app with Android Studio using the Andengine. After I have imported the andengine.jar and the libandenginephysicsbox2dextension.jar everything seemed to work correctly. At the point where the PhysicsWorld is created:

private void createPhysics() {
        physicsWorld = new FixedStepPhysicsWorld(60, new Vector2(0, -17), false);
        registerUpdateHandler(physicsWorld);
    }

出现此异常:java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.sample.packet.sample-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libandenginephysicsbox2dextension.so"

我认为我必须下载* .so文件,但是我不知道将其放置在项目中的什么位置.有人可以帮忙吗?

I think I must download the *.so file but I don't know where to place it in my project. Could anyone help?

推荐答案

您可以在这里按照我的回答 https://stackoverflow.com/a/34068202/2026280

you can follow my answer here https://stackoverflow.com/a/34068202/2026280

非常简单.遵循以下简单步骤

Its very simple. Follow this simple steps

1).在主应用的libs文件夹内创建一个名为"lib" 的新文件夹.

1) Create a new folder called "lib" inside the libs folder of the main app.

2)和EnginePhysicsBox2DExtension/libs 文件夹复制所有文件夹,例如armabi,armabi-v7a等,并粘贴到先前创建的"lib"中文件夹中的主应用.

2) Copy all the folders ie.armabi , armabi-v7a etc from andEnginePhysicsBox2DExtension/libs folder, and paste in in the previously created "lib" folder in main app.

3)现在将"lib" 文件夹压缩为"lib.zip" ,并将其重命名为"lib.jar ". 这会将 zip 扩展名更改为 jar .

3) Now compress the "lib" folder as "lib.zip" and rename it to "lib.jar". this changes the zip extension to jar.

4)最后在 Build.gradle 文件中的依赖项{}下添加一行-编译文件('lib.jar')您的主应用.

4) Finally add a line -- compile files('lib.jar') under dependencies{} in Build.gradle file of your main app.

5).清理并构建项目.

这篇关于如何在Android Studio中添加libandenginephysicsbox2dextension.so文件.引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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