Android and Libgdx Problem
Android and Libgdx Problem
LibGDX OPENGL 2 (18 Jan 2018) :
(1) glEsVersion : AndroidManifest : <uses-feature android:glEsVersion="0x00020000" android:required="true" />
(2) Project Structure : Android Plugin Repository --> REMOVE google()
(3) LibGDX : import com.badlogic.gdx.graphics.GL20;
version = '1.0'
ext {
appName = "Text2018"
gdxVersion = '1.9.6'
roboVMVersion = '2.3.1'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
}
(4) OPENGL 2 : LibGDX Generate 3D Project : https://libgdx.badlogicgames.com/download.html
Reference :
https://services.gradle.org/distributions/
https://libgdx.badlogicgames.com/documentation/gettingstarted/Setting%20Up.html
https://developer.android.com/studio/archive.html
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
Android Plugin Version (B) : https://developer.android.com/studio/releases/gradle-plugin.html
(ERROR MESSAGE A) :
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java -Didea.launcher.port=54748 "-Didea.launcher.bin.path=/Applications/Android Studio.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Users/sankipoon/Desktop/android-sdk-macosx/platforms/android-8/android.jar:/Users/sankipoon/Desktop/android-sdk-macosx/platforms/android-8/data/res:/Volumes/40G PROGRAM/Projects/Test2018/desktop/build/classes/java/main:/Volumes/40G PROGRAM/Projects/Test2018/core/build/classes/java/main:/Volumes/40G PROGRAM/Projects/Test2018/core/build/libs/core-1.0.jar:/Volumes/40G PROGRAM/Projects/Test2018/desktop/build/libs/desktop-1.0.jar:/Applications/Android Studio.app/Contents/lib/idea_rt.jar" com.intellij.rt.execution.application.AppMainV2 com.imediabank.text2018.desktop.DesktopLauncher
Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/ApplicationListener
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:260)
at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:107)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.ApplicationListener
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Process finished with exit code 1
Problem : Your Driver doesn't supported video Device
Solved : 1. Add "<uses-feature android:glEsVersion="0x00020000" android:required="true" />" to DesktopLauncher
2. Install Java SE 7 with Jre to System and disable current version.
3. Modify EDIT DesktopLauncher : JRE to c:\Prog......\java\jdk1.7.0_80\jre
Problem : RUN :html on Gradle in Android Studio
Solved : 1. See what App engin on Gradle
2. Open Terminal in Android Studio
3. GOTO Project folder e.g. ...../Projects/projectABC/
4. (MAC only) modify gradlew to "chmod 755 gradlew",
5. Start Engin : ./gradlew html:jettyRUN
6. Open Browser : http://localhost:8080/html
Problem :Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
Solved : Add flavorDimensions "default" to Android --> build.properties
Reference :
https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
http://blog.csdn.net/SYIF88/article/details/75009663
http://blog.csdn.net/small_technical/article/details/72782671
http://www.cnblogs.com/bluestorm/p/7374903.html
Problem : SSL peer shut down incorrectly
Solution 1 :
gradle-wrapper.properties copy and Download "distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip"
Copy unZIp to "C:\Program Files\Android\Android Studio\gradle"
Solution 2 :
Download Again and Again. Let System Correct Only, Don't have to change anything.
Problem :LibGDX doesn't suppert Android Studio 3.0
Solution :
Android Studio 3.0 using gradle-4.1 and com.android.tools.build:gradle:3.0.0
Gradle 4.1 is not supported yet in LibGDX, there is an open issue for the same.
Currently html module using deprecated jetty plugin which is removed in Gradle 4.1 version.
However using Terminal you can run desktop module, I've not tested on windows but on Mac it's working fine.
./gradlew desktop:run
For now you can use lower version of Gradle and Andoid-gradle-plugin in Android Studio 3.0 and wait for issue to be fixed.
Downgrade Gradle version from 4.1 to 3.3
Find gradle folder inside your project, Open gradle-wrapper.properties and change distributionUrl for 3.3
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
Downgrade Android-gradle-plugin version from 3.0.0 to 2.3.3
Open root build.gradle file and find artifact in buildscript and change version
classpath 'com.android.tools.build:gradle:2.3.3'
Comment/delete google() from repo list inside root build.gradle file
down vote
accepted
Reference :
https://services.gradle.org/distributions/
https://libgdx.badlogicgames.com/documentation/gettingstarted/Setting%20Up.html
https://developer.android.com/studio/archive.html
Problem : gdx-video install into android studio under Libgdx
Dwonload : https://oss.sonatype.org/#nexus-search;quick~jnigen/
gdx-video-<version>.jar
gdx-vide-desktop.xxxx.jar
gdx-jnigan.xxxx.jar
gdx-video-android.xxxx.jar
------------------------------------------Install
copy all jar into android->libs
right click and "Add to Library"
open and edit master build.gradle
edit corn, desktop and android : compile files('libs/gdx-video-desktop/android/corn.jar')
ref : https://recordnotfound.com/gdx-video-libgdx-84982
Problem : Import Texture and Material into OBJ
Texture texture = new Texture(Gdx.files.internal("TriMagic/magic2.png"), Pixmap.Format.RGBA4444, false);
Material mat = new Material("Material.001",
TextureAttribute.createDiffuse(texture));
TriMagicOBJInstance.materials.get(0).set(mat);
Problem : Convert JAVA to LIBGDX
* ADD *
@Override
public void create () {
}
@Override
public void buildStage() {
}
* ADD *
extends AbstractScreen implements ApplicationListener, InputProcessor {
* ADD *
@Override
public void render (float delta) {}
@Override
public void render () {}
* ADD *
: Screen Animation move around for Libgdx
@Override
public void show() {
// ------------ MOST HERE FOR SCREEN CONTROL MOVE
}
* ADD *
//protected CameraInputController camController;
protected InputGame camController;
* ADD *
ProjectMaster game;
public SelectObject(ProjectMaster game) {
this.game = game;
}
PROBLEM: OUT OF MEMORY COMPLIER and RUN ON ANDROID DEVICE
Modify : Top : build.properties
org.gradle.daemon=true
org.gradle.jvmargs=-Xms128m -Xmx1024m
org.gradle.configureondemand=true