1. <legend id='laKJV'><style id='laKJV'><dir id='laKJV'><q id='laKJV'></q></dir></style></legend>

      <small id='laKJV'></small><noframes id='laKJV'>

      • <bdo id='laKJV'></bdo><ul id='laKJV'></ul>

        <tfoot id='laKJV'></tfoot>
        <i id='laKJV'><tr id='laKJV'><dt id='laKJV'><q id='laKJV'><span id='laKJV'><b id='laKJV'><form id='laKJV'><ins id='laKJV'></ins><ul id='laKJV'></ul><sub id='laKJV'></sub></form><legend id='laKJV'></legend><bdo id='laKJV'><pre id='laKJV'><center id='laKJV'></center></pre></bdo></b><th id='laKJV'></th></span></q></dt></tr></i><div id='laKJV'><tfoot id='laKJV'></tfoot><dl id='laKJV'><fieldset id='laKJV'></fieldset></dl></div>

        Libgdx 游戏在 Android 上崩溃

        时间:2023-05-19
      1. <i id='sIbrg'><tr id='sIbrg'><dt id='sIbrg'><q id='sIbrg'><span id='sIbrg'><b id='sIbrg'><form id='sIbrg'><ins id='sIbrg'></ins><ul id='sIbrg'></ul><sub id='sIbrg'></sub></form><legend id='sIbrg'></legend><bdo id='sIbrg'><pre id='sIbrg'><center id='sIbrg'></center></pre></bdo></b><th id='sIbrg'></th></span></q></dt></tr></i><div id='sIbrg'><tfoot id='sIbrg'></tfoot><dl id='sIbrg'><fieldset id='sIbrg'></fieldset></dl></div>
      2. <small id='sIbrg'></small><noframes id='sIbrg'>

          <bdo id='sIbrg'></bdo><ul id='sIbrg'></ul>
          <tfoot id='sIbrg'></tfoot>

                <legend id='sIbrg'><style id='sIbrg'><dir id='sIbrg'><q id='sIbrg'></q></dir></style></legend>

                  <tbody id='sIbrg'></tbody>

                  本文介绍了Libgdx 游戏在 Android 上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我使用 libgdx 制作了一个游戏,它之前在桌面和安卓上都可以正常运行.我不确定是不是因为我开始使用box2d物理引擎和liquidfun粒子,基本上发生的情况是,当我在我的游戏上单击播放时它开始加载,然后加载后它应该进入游戏屏幕,但它崩溃然后说不幸的是,myGame 已停止".

                  I made a game using libgdx and it runs fine on both desktop and android before. I'm not sure if its because I started using box2d physics engine and liquidfun particles,what basically happens is that when I click play on my game it start loading then after loading it should go to the gameScreen, but it crashes then says "Unfortunately, myGame has stopped".

                  错误信息:

                  E/AndroidRuntime: FATAL EXCEPTION: GLThread 3764
                  Process: com.nivekbryan.puffypuff, PID: 8416
                  java.lang.NoClassDefFoundError: Failed resolution of: Lcom/badlogic/gdx/physics/box2d/World;
                  

                  我按照这个设置教程了解如何移植liquidfun库,它从 2014 年开始有点旧.游戏可以作为桌面应用程序运行.

                  I followed this setup tutorial on how to port liquidfun library, its from 2014 kinda old. The game runs Ok as desktop application.

                  这是我的 build.gradle 文件(依赖项),可能是什么问题?为什么是桌面应用而不是安卓应用?

                  This is my build.gradle file (dependencies), what could be the problem? and why is working as desktop application and not as an android application?

                  buildscript {
                      repositories {
                          mavenLocal()
                          mavenCentral()
                          maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
                          jcenter()
                      }
                      dependencies {
                          classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
                          classpath 'com.android.tools.build:gradle:2.0.0'
                          classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.1.0'
                      }
                  }
                  
                  allprojects {
                      apply plugin: "eclipse"
                      apply plugin: "idea"
                  
                      version = '1.0'
                      ext {
                          appName = "Puffy Puff"
                          gdxVersion = '1.9.3'
                          roboVMVersion = '2.1.0'
                          box2DLightsVersion = '1.4'
                          ashleyVersion = '1.7.0'
                          aiVersion = '1.8.0'
                          admobVersion = '8.3.0'
                      }
                  
                      repositories {
                          mavenLocal()
                          mavenCentral()
                          maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
                          maven { url "https://oss.sonatype.org/content/repositories/releases/" }
                      }
                  }
                  
                  project(":desktop") {
                      apply plugin: "java"
                  
                  
                      dependencies {
                          compile project(":core")
                          compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
                          compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
                  
                          compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
                          compile fileTree(dir: 'libs', include: '*.jar')
                      }
                  }
                  
                  project(":android") {
                      apply plugin: "android"
                  
                      configurations { natives }
                  
                      dependencies {
                          compile project(":core")
                          compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
                          natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
                          natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
                          natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
                          natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
                          natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
                  
                          compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
                          natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
                          natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
                          natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
                          natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
                          natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"
                          compile "com.google.android.gms:play-services-ads:8.3.0"
                          compile fileTree(dir: 'libs', include: '*.so')
                      }
                  }
                  
                  project(":ios") {
                      apply plugin: "java"
                      apply plugin: "robovm"
                  
                  
                      dependencies {
                          compile project(":core")
                          compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
                          compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
                          compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
                          compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
                  
                          compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
                      }
                  }
                  
                  project(":html") {
                      apply plugin: "gwt"
                      apply plugin: "war"
                  
                  
                      dependencies {
                          compile project(":core")
                          compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
                          compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
                          compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
                      }
                  }
                  
                  project(":core") {
                      apply plugin: "java"
                  
                  
                      dependencies {
                          compile "com.badlogicgames.gdx:gdx:$gdxVersion"
                  
                          compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
                          compile fileTree(dir: 'libs', include: '*.jar')
                      }
                  }
                  
                  tasks.eclipse.doLast {
                      delete ".project"
                  }
                  

                  更新:

                  我找到了这个解决方案 link 所以我复制了 gdx-liquidfun.jar 到 Android -> libs 然后右键单击并添加为库,但我仍然得到错误.请帮忙,在此先感谢(我正在使用 Intellij 社区版)

                  I found this solution link so what I did is I copied gdx-liquidfun.jar to Android -> libs then right click and add as library, but I still get the error. Help please, thanks in advance (I'm using Intellij Community Edition)

                  推荐答案

                  把这个放到android依赖中:

                  Put this in the android dependencies:

                      natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
                      natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
                      natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
                  

                  这在核心依赖中:

                      compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
                  

                  这篇关于Libgdx 游戏在 Android 上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 Libgdx/Java 绘制文本? 下一篇:在 Libgdx 中实现简单运动模糊的意外结果

                  相关文章

                  最新文章

                  <legend id='e3evq'><style id='e3evq'><dir id='e3evq'><q id='e3evq'></q></dir></style></legend>
                  • <bdo id='e3evq'></bdo><ul id='e3evq'></ul>

                  <small id='e3evq'></small><noframes id='e3evq'>

                    <i id='e3evq'><tr id='e3evq'><dt id='e3evq'><q id='e3evq'><span id='e3evq'><b id='e3evq'><form id='e3evq'><ins id='e3evq'></ins><ul id='e3evq'></ul><sub id='e3evq'></sub></form><legend id='e3evq'></legend><bdo id='e3evq'><pre id='e3evq'><center id='e3evq'></center></pre></bdo></b><th id='e3evq'></th></span></q></dt></tr></i><div id='e3evq'><tfoot id='e3evq'></tfoot><dl id='e3evq'><fieldset id='e3evq'></fieldset></dl></div>

                      <tfoot id='e3evq'></tfoot>