java - LibGDX ClassNotFound on Android -


i'm using libgdx game shares code project. put code in .jar library have added in root build.gradle.

everything works fine on desktop, when launch game on android crashes classnotfound exception. can't find class of library.

can me out? have no idea causing problem.

edit: changes build.gradle:

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')     } } 

you need add same filetree dependency directly in android module because android gradle plugin can't handle transitive flat file dependencies.

project(":core") {    ...    compile filetree(dir: '../libs', include: '*.jar')    ... }  // ,  project(":android") {    ...    compile filetree(dir: '../libs', include: '*.jar')    ... } 

source.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -