Android Problem

Android Problem

LibGDX OPENGL 2 (18 Jan 2018) : 
 Compatible
Android Studio / LibGDX
 WORK WORKWORK     NOT WORK NOT WORK NOT WORK
 Android Studio 3.0.13.0.1 2.3X     3.0.1  3.0.13.0.1 
 build.gradle : Gradle (B) 3.3 3.33.3    3.3   4.1 3.5
 build.gradle : 
Android Plugin (B)
 2.3.3 2.3.3 2.3.3   2.3.3  3.0.1 2.3.2
 Java  7,8 7,8 7,8    9  7,8,9 7,8,9
 buildToosVersion 26.0.2  26.0.226.0.2    26.0.2  26.0.2 26.0.2 
compilSdkVersion 2323  23   23  23 23
LibGDX (3) 1.9.6 1.9.6 1.9.6    1.9.6   1.9.6 1.9.6 
OPENGL (4) 2    2
 glEsVersion (1) Y Y Y    Y
 Android Plugin / Default Library : Google() (2) N N    Y
 DesktopWORKWork Work     Not WorkNot Work Not Work 
 ERROR MSG (A)       (A) (A) (A)
  • (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




Plugin versionRequired Gradle version
1.0.0 - 1.1.32.2.1 - 2.3
1.2.0 - 1.3.12.2.1 - 2.9
1.5.02.2.1 - 2.13
2.0.0 - 2.1.22.10 - 2.13
2.1.3 - 2.2.32.14.1+
2.3.0+3.3+
3.0.0+4.1+


(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 : 
  1. gradle-wrapper.properties copy and Download "distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip"
  2. Copy unZIp to "C:\Program Files\Android\Android Studio\gradle"

Solution 2 :
  1. Download Again and Again. Let System Correct Only, Don't have to change anything.

Problem :LibGDX doesn't suppert Android Studio 3.0 


Solution :down voteaccepted

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


Reference : 
https://services.gradle.org/distributions/
https://libgdx.badlogicgames.com/documentation/gettingstarted/Setting%20Up.html
https://developer.android.com/studio/archive.html






Comments