Andoid assets load

Where create Resources assets folder for android application so that it connects automatically? (as in application for computer)

How to load assets from java package?
or i need create /assets/ folder on project root and add to gradle?

If you are building a cross platform game, I suggest using this template, the game logic resides inside the game module and so the assets which are packaged into a jar and added to both the desktop and the android module, clone and try it on your favourite IDE :wink::

But, you need to upgrade the jme3 version.

EDIT:
One good feature of this template is it separates platform independent and platform dependent code, so if you have a game that utilizes hardware, you can utilize this template too…

2 Likes

Try to build project
AILURE: Build failed with an exception.

  • Where:
    Script ‘/home/ivan/CrossPlatformModule-master/app/build.gradle’ line: 2

  • What went wrong:
    An exception occurred applying plugin request [id: ‘com.android.application’]

Failed to apply plugin ‘com.android.internal.version-check’.
Minimum supported Gradle version is 7.0.2. Current version is 6.7.1. If using the gradle wrapper, try editing the distributionUrl in /home/ivan/CrossPlatformModule-master/gradle/wrapper/gradle-wrapper.properties to gradle-7.0.2-all.zip

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

gradle -version

Welcome to Gradle 7.2!

Here are the highlights of this release:

  • Toolchain support for Scala
  • More cache hits when Java source files have platform-specific line endings
  • More resilient remote HTTP build cache behavior

For more details see Gradle 7.2 Release Notes


Gradle 7.2

Build time: 2021-08-17 09:59:03 UTC
Revision: a773786b58bb28710e3dc96c4d1a7063628952ad

Kotlin: 1.5.21
Groovy: 3.0.8
Ant: Apache Ant™ version 1.10.9 compiled on September 27 2020
JVM: 16.0.1 (Private Build 16.0.1+9-Ubuntu-120.04)
OS: Linux 5.15.0-60-generic amd64

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    // define android system repositories
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.4"        // in the individual module build.gradle files
    }
}

// all modules repos
allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

Update for jmonkey 3.5.2 gradle 7.2 and test units