Minie for Androids

I’m surprised that the z-fighting only happens on Minie; I’ll think about why that might be different between Minie and jme3-bullet.

However, both behaviors point to a bug in the underlying code (jme3-core or OpenGL or …) since the default debug visualization is supposed to be wireframe, not solid. I’m running low on ideas how to work around that bug.

Does anybody know of wireframe materials that work on Android?

Could be that collision shape margin is different?

1 Like

Thanks for the suggestion.

I think that’s unlikely to explain the differences, since:

  1. The default margin in jme3-bullet v3.3 was changed to 0.04 by PR 1053, so the margins should be same for both libraries.
  2. BoxCollisionShape is a precise shape, so margin shouldn’t affect its visualization.

Edit: I think I found a workaround for the Z-fighting (see below), but the Android wireframe issue remains a mystery.

        ViewPort overlay = renderManager.createPostView("Overlay", cam);
        overlay.setClearFlags(false, true, false);
        bulletAppState.setDebugViewPorts(overlay);

Edit: We’re not the first to notice the Android wireframe issue: PhysicsDebugGeometry drawn solid

Does anybody know of wireframe materials that work on Android?

Seems OpenGL ES does not support glPolygonMode

I think there is an alternative approach explained here in case you like:

http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/

1 Like

Thanks for those links @Ali_RS!

At present, I don’t have the shader skills to implement that workaround. In case someone else is willing to work on it, I’ve opened issue 1345.

I’m going to revert to using wireframe.j3md for this Minie release.

1 Like

Unless there are other, more serious issues, I plan to cut the Minie v1.6 release tonight.

Thanks again, @ndebruyn, for volunteering to be my Android tester! I’d never have got this far without your help.

5 Likes

I donot know if this topic of testing Minie 3.0.0+debug is still valid or not , but i was testing it on Emulators & it works fine , but on physical device , it works the first 2 days , but its now disabling the apk from being installed on my physical device , i have tried Minie 2.0.1+debug also on a separate non jme blank android project & it didnot work either , when removing Minie implementation , the apk is installed successfully ! my gradle version is gradle:4.0.2

2 Likes

Minie v3.0.0 is still the latest release, so I’m interested in any issues with it.

  1. I’m not sure what might make an APK “invalid”. Any ideas?
  2. Do non-debug versions of Minie exhibit the same issue on physical devices?
  3. What was the last version of Minie that worked with physical devices?
2 Likes

1-I think Using invalid package names like Minie-m or Minie m (a space) could potentiates for this

2- I have tried Minie3.0.0 & it’s debug version & the same results , they were working at the first 2 days , then I got a problem in Gradle cache called , cannot open zip file , so I have deleted Gradle/wrapper/dists & redownloaded it which fixed the **cannot open zip file problem ** but Minie stops working from that point inspite of android apps are working !!

There may be something in Gradle

Interesting. However, since package names don’t change over time, an invalid package name wouldn’t explain why the issue showed up after 2 days and not immediately.

The 2-day delay suggests to me that memory is gradually getting corrupted.

1 Like

@sgold okay , after a couple of tests & comparasions with the basic-android-template gradle & my gradle , i have found that i have changed the minSdkVersion from API LEVEL 16(Android JellyBean) to 30(ANdroid Nougat) for purposes of androidx developement , so when i switched them back , the apk is installed successfully ,the same thing implied on debug & non-debug, Do you use something that relies on Android JellyBean , EDIT & if so , it should work normally on min higher versions too?

1 Like

When the native library was compiled for Android, I specified “compileSdkVersion 28”. I imagine that might cause issues if the application were built using an older SDK version.

2 Likes

@sgold yes that might be true , Android Studio uses the same version for complieSDKVersion & targetSDKVersion & usually the targetSDKVersion must be API LEVEL 29 which is android10 or higher , in case of mine its API LEVEL 30 which is androidR since we have passed Nov2,2020 - this doesnot relate to android or jme independant developement but its for publishing on Gplay through Gplay Console for the first place , & to apply secuirty rules :slight_smile:

if you need more info :slight_smile:

https://developer.android.com/distribute/best-practices/develop/target-sdk?authuser=1

Currently testing Minie on Android this way wonot be very accurate on Emulators , due to the reason that Android Roms & Aspect Ratios differs dramatically plus you cannot fully test something on a debug apk , so its best to test that on a release on GPlay Console & google play :smile:

https://developer.android.com/distribute/best-practices/develop/test-your-app?authuser=1

I am working on Android game that’s Something like Pysonix Rocket League , i am using MinieV3 but till now i think if i finished it , i cannot release it on GPlay with min API LEVEL 16 becuase you know noOne cares about dirty JellyBean & there would be UnHandleable problems due to depracations & using high features , but anyway if you fixed the current problem , i will release the app On GPlay , i have an acc already , & follow that game analytics/errors/crashes/reports/etc on Gplay Console, & give a REAL LIVE TRY for Minie & JMe Android :slight_smile:

1 Like

Most of time android studio returns INSTALL_FAILED_INSUFFICIENT_STORAGE in case of memory issues & its something related to :
the app size or physical device memory

i have just listed that for illustration.

Are you requesting a version of Minie to be built using a different Android SDK version? I’m willing, just waiting to be told what to do.

1 Like

Yes , please :grinning:

1 Like

Please try Minie v3.1.0-test1. Its Android native libraries were built using Android SDK v30.

2 Likes

Thanks @sgold , I really appreciate your hard work , but the same problem exists may be there’s something with Android NDK codes , i donot know what the underlying problem , but i found something , that the maximum API LEVEL to set for minSDKVersion for an app using Minie3.0.0 or the test that you have built using SDK v30 is API22 which is android5 , & thats a good news , so till now its fine but its better to use API25 :grinning:

this my gradle file , if i set the minSDKVersion to 23 MarshMallow , i will get INVALID_APK error :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.2"

    defaultConfig {
        applicationId "com.myGame"
        minSdkVersion 22
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
    implementation 'androidx.navigation:navigation-fragment:2.3.0'
    implementation 'androidx.navigation:navigation-ui:2.3.0'
    implementation project(path: ':GamePad')
    testImplementation 'junit:junit:4.13.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation "org.jmonkeyengine:jme3-core:3.3.2-stable"
    implementation "org.jmonkeyengine:jme3-effects:3.3.2-stable"
    implementation "org.jmonkeyengine:jme3-android-native:3.3.2-stable"
    implementation 'com.github.stephengold:Minie:3.1.0-test1'
}

I am not releasing my apk right now , so you can take your time to figure out the problem :slight_smile: , Thank you , Best Regards !

Edit : I can upload a 1 min video for what’s happening if you want :slightly_smiling_face:

1 Like

I appreciate your patience. As you’ve probably noticed, I’m not an Android developer. I need guidance from someone with more knowledge than I currently have.

Here’s the key portion of the “android.gradle” file I’m currently using to build native libraries:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
    }
}
apply plugin: 'com.android.library'

String flavor = 'Sp' 
if (gradle.rootProject.hasProperty('flavor')) {
    flavor = gradle.rootProject.ext.flavor
}

android {
    buildTypes.debug {
        jniDebuggable = true
    }
    compileSdkVersion 30
    defaultConfig.ndk {
        //abiFilters 'x86_64'
    }
    externalNativeBuild.ndkBuild {
        path 'Android.mk'
    }
    ndkVersion '21.0.6113669'
}

repositories {
    google()
    jcenter()
}

Unless someone has other ideas, I’ll continue upgrading software.

1 Like

In Android
apps development we donot deal with NDK or native code so much :slightly_smiling_face: , we usually deal with Android SDK which is written in java & runs on Dalvik VM

By the way , I have found this version suspicious ,

it seems out dated , seriously I cannot see it on android NDK versions , you can update NDK to the latest :slightly_smiling_face: , & I think It would be better if you specify a targetSDKVersion of 30(very crucial not to be less than 29) & minSDKVersion of 22 or lesser if you want (it’s up to you) , i encourage using Android studio modules to create Android Libraries just because everything would be uptoDate :slightly_smiling_face:

Edit : I have searched about this NDK version you are using , found that’s the default NDK version stated by Gradle 4.0.1 , so you can try updating the Gradle & the NDK to the latest !

Android Modules :

OutDated NDK Versions :

New Versions , the latest would be better I think :-

The latest NDK 2020 v21d:-

1 Like