Google just changed the rule so that since the start of August so that your app must be API 29 or greater. Solar2D just added compatibility with that – that all seems to be great.
However, since updating from build 3600, I cannot get my game to build on my android device.
The first error I got was:
/private/var/folders/2q/6xnd00dn6jb9sqnykyrqk7pc0000gn/T/CLtmpMOEMyC/template/app/src/main/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.android.gms:play-services-ads:19.3.0] /Users/briann/.gradle/caches/transforms-2/files-2.1/66469a18cab037909539f040355bc192/jetified-play-services-ads-19.3.0/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.android.gms.ads.impl" to force usage (may lead to runtime failures)
I could fix this by editing build.settings:
android {
minSdkVersion = "16",
}
Now I can build the app, but when I start it on the device, I get a Runtime error:
HTCONE: ERROR: Runtime error
Aug 02 19:43:26.259 HTCONE: java.lang.NoClassDefFoundError: com.google.android.gms.common.GoogleApiAvailability
HTCONE: Java Stack Trace:
HTCONE: shared.google.play.services.base.GooglePlayServicesAvailabilityHandler.handleGooglePlayServicesAvailability(GooglePlayServicesAvailabilityHandler.java:281)
HTCONE: shared.google.play.services.base.LuaLoader$HandleGooglePlayServicesAvailabilityWrapper.invoke(LuaLoader.java:159)
HTCONE: com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)
HTCONE: com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:403)
HTCONE: com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:391)
HTCONE: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1614)
HTCONE: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
H
Aug 02 19:43:26.260 TCONE: stack traceback:
HTCONE: [C]: in function 'handleGooglePlayServicesAvailability'
HTCONE: ?: in main chunk
HTCONE: This application failed to load and execute main.lua
It seems like a brand new issue due to Google Play’s requiring API 29, so I assume other people will hit the same problem soon.
I don’t really know what’s going on here, even if it’s a Solar2D issue, or if my device is too old now, so any advice is appreciated!
Thanks agramonte, I haven’t gotten that to work yet (I haven’t even been using an AndroidResources folder for this older project so I need to work that out) but I understand the problem better now. It sounds like it may get rolled into the next Solar2d release too.
I have not built anything for Android 15 in a while, I am fairly sure you can make it work. Just not sure how many plugins would actually work with Android 15. I mostly keep to Android 16 for Amazon and Android 19 for Google.
Unfortunately, solutions in this topic don’t help. My version of the problem is quite similar, but Runtime error after building with the 16th minSdkVersion is different:
I got a similar error when I enable the OneSignal plugin:
/private/var/folders/4j/m59mm3h17ml6d5mxx92l8wcr0000gn/T/CLtmpMXtccO/template/app/src/main/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-messaging:20.2.3] /Users/chema/.gradle/caches/transforms-2/files-2.1/25a4ee619d35555f682164da12d8bc69/jetified-firebase-messaging-20.2.3/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.firebase.messaging" to force usage (may lead to runtime failures)
I have the same problem with OneSignal. While googling for solution found this: https://github.com/OneSignal/OneSignal-Android-SDK/issues/1018. Maybe it should help to localize problem. Though I was unable to get version of OneSignal SDK used in Solar.
Hopefully Vlad fixes it because I’m very dependent on OneSignal.
I still get the below error:
> Task :App:checkReleaseDuplicateClasses FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':App:checkReleaseDuplicateClasses'.
> 1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.android.gms.internal.measurement.zzbv found in modules jetified-play-services-measurement-16.5.0-runtime.jar (com.google.android.gms:play-services-measurement:16.5.0) and play-services-measurement-base-17.1.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.1.0)
Duplicate class com.google.android.gms.internal.measurement.zzbw found in modules jetified-play-services-measurement-16.5.0-runtime.jar (com.google.android.gms:play-services-measurement:16.5.0) and play-services-measurement-base-17.1.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.1.0)
Duplicate class com.google.android.gms.internal.measurement.zzdf found in modules jetified-play-services-measurement-impl-16.5.0-runtime.jar (com.google.android.gms:play-services-measurement-impl:16.5.0) and play-services-measurement-base-17.1.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.1.0)
Duplicate class com.google.android.gms.internal.measurement.zzdg found in modules jetified-play-services-measurement-impl-16.5.0-runtime.jar (com.google.android.gms:play-services-measurement-impl:16.5.0) and play-services-measurement-base-17.1.0-runtime.jar (com.google.android.gms:play-services-measurement-base:17.1.0)
It seems the conflict is because of Appodeal Admob. When I disabled Appodeal Admob, it was built without errors.