I have an Amazon app that used the GameCircle plugin, which I am updating for the first time since March 2019. I know that GameCircle was disconnected back in 2018, but existing apps are still supposed to support it. However, when I tried to build my app today with Solar2D Build 2022.3673, I ran into the Error 256, which only occurs if the GameCircle plugin is included in the build.settings. The specific error is:
Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/private/var/folders/80/73y5tf3x0019_mb2qykw72980000gn/T/CLtmp7UX2Du/template/app/src/main/AndroidManifest.xml Error:
Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':App:processReleaseMainManifest'.
> Manifest merger failed : Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
* 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
BUILD FAILED in 18s
Android build failed (256) after 22 seconds
ERROR: Build Failed: Error code: 256
Is it possible to get it to build with this plugin?
So basically it seems like it wants me to add ‘android:exported=“true”’’ to the tags for com.amazon.identity.auth.device.authorization.AuthorizationActivity and com.amazon.identity.auth.device.authorization.PackageIntentReceiver.
So I tried to define it in my build.settings under applicationChildElements but the compiler then complained I had a duplicate element defined.
/private/var/folders/80/73y5tf3x0019_mb2qykw72980000gn/T/CLtmptoaivO/template/app/src/main/AndroidManifest.xml:87:11-88:20 Error:
Element activity#com.amazon.identity.auth.device.authorization.AuthorizationActivity at AndroidManifest.xml:87:11-88:20 duplicated with element declared at AndroidManifest.xml:60:5-71:16
/private/var/folders/80/73y5tf3x0019_mb2qykw72980000gn/T/CLtmptoaivO/template/app/src/main/AndroidManifest.xml:90:11-91:20 Error:
Element receiver#com.amazon.identity.auth.device.authorization.PackageIntentReceiver at AndroidManifest.xml:90:11-91:20 duplicated with element declared at AndroidManifest.xml:74:5-82:16
/private/var/folders/80/73y5tf3x0019_mb2qykw72980000gn/T/CLtmptoaivO/template/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
OK, so I guess I need to know how to modify an existing element in the manifest.xml without having to declare it again. Anyone?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':App:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class org.apache.http.client.methods.HttpPatch found in modules jetified-httpclient-4.5 (org.apache.httpcomponents:httpclient:4.5.5) and jetified-plugins (plugins.jar)
Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.
* 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
BUILD FAILED in 36s
Android build failed (256) after 40 seconds
ERROR: Build Failed: Error code: 256
A new issue is that when I attempt to show the leaderboard there is a RunTime error. I’m calling gameNetwork.Leaderboard.OpenOverlay() (this used to work fine) :
Mi A1: ERROR: Runtime error
Mi A1: java.lang.NullPointerException: Attempt to invoke interface method 'com.amazon.ags.api.AGResponseHandle com.amazon.ags.api.leaderboards.LeaderboardsClient.showLeaderboardsOverlay(java.lang.Object[])' on a null object reference
Mi A1: Java Stack Trace:
Mi A1: plugin.gamecircle.LuaLoader.OpenLeaderboardOverlay(LuaLoader.java:1027)
Mi A1: plugin.gamecircle.LuaLoader$OpenLeaderboardWrapper.invoke(LuaLoader.java:2236)
Mi A1: com.ansca.corona.JavaToNativeShim.nativeRender(Native Method)
Mi A1: com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:205)
Mi A1: com.ansca.corona.Controller.updateRuntimeState(Controller.java:364)
Mi A1: com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
Mi A1: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
Mi A1: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
Mi A1: stack traceback:
Mi A1: [C]: in function 'OpenOverlay'
Mi A1: ?: in function <?:87>
Mi A1: ERROR: Runtime error
Mi A1: java.lang.NullPointerException: Attempt to invoke interface method 'com.amazon.ags.api.AGResponseHandle com.amazon.ags.api.leaderboards.LeaderboardsClient.showLeaderboardsOverlay(java.lang.Object[])' on a null object reference
Mi A1: Java Stack Trace:
Mi A1: plugin.gamecircle.LuaLoader.OpenLeaderboardOverlay(LuaLoader.java:1027)
Mi A1: plugin.gamecircle.LuaLoader$OpenLeaderboardWrapper.invoke(LuaLoader.java:2236)
Mi A1: com.ansca.corona.JavaToNativeShim.nativeRender(Native Method)
Mi A1: com.ansca.corona.JavaToNativeShim.render(JavaToNativeShim.java:205)
Mi A1: com.ansca.corona.Controller.updateRuntimeState(Controller.java:364)
Mi A1: com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:434)
Mi A1: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1625)
Mi A1: com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1380)
Mi A1: stack traceback:
Mi A1: [C]: ?
Mi A1: [C]: in function 'OpenOverlay'
Mi A1: ?: in function <?:87>