Closed mleenhardt closed 5 years ago
Hey @mleenhardt,
I just verified both PRO and FREE builds from the Asset Store: everything works as expected. Please, follow this guide to troubleshoot
I have re-installed the plugin before entering this issue, it didn't seem to cause any files to change compared to before the re-install.
Should lunar-console.aar be anywhere in the built APK? I can see the file being written out to /Temp/gradleOut/libs/lunar-console.aar
during the build process.
As far as I can tell, the "Install" menu in the Lunar Console option just creates a prefab in the current scene. Is having the prefab in the first scene at edit time a requirement?
No, there's no such requirement. I would need to take a closer look at it. It would be helpful if you can share more integration details or a sample project.
On Wed, Apr 3, 2019, 6:24 PM Mathieu Leenhardt notifications@github.com wrote:
As far as I can tell, the "Install" menu in the Lunar Console option just creates a prefab in the current scene. Is having the prefab in the first scene at edit time a requirement?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SpaceMadness/lunar-unity-console/issues/139#issuecomment-479714684, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwA1G_XX8-aRKG_zhi-H-_yICm3o5_Bks5vdVRlgaJpZM4cbqmy .
It turns out that this was caused by Proguard minification. We previously had EditorUserBuildSettings.androidDebugMinification
and EditorUserBuildSettings.androidReleaseMinification
set to AndroidMinification.Proguard
. Setting them to AndroidMinification.None
fixes the issue and causes the console to work fine. I'm assuming that using a custom Proguard template and explicitly specifying that lunar-console.aar shouldn't be stripped out would also do the trick.
@mleenhardt, here's ProGuard config file (Assets/Plugins/Android/proguard-user.txt
)
-keep public class spacemadness.com.lunarconsole.settings.*
-keepclassmembers class spacemadness.com.lunarconsole.settings.* {
public *;
}
-keep public enum spacemadness.com.lunarconsole.settings.ExceptionWarningSettings$** {
**[] $VALUES;
public *;
}
-keep public enum spacemadness.com.lunarconsole.settings.Gesture {
**[] $VALUES;
public *;
}
-keep public class spacemadness.com.lunarconsole.console.NativeBridge
-keepclassmembers class spacemadness.com.lunarconsole.console.NativeBridge {
public *;
}
We're seeing the following exception when trying to initialize the plugin on Android. We're building using the built-in gradle build system with Unity 2018.3.0f2, we're using Lunar Console 1.6 (latest on the asset store). We're not seeing any issue on iOS, the console works just fine on this platform.
The APK seems to be containing what it should, I can see many Lunar Console related files in it. The plugin (lunar-console.aar) seems to be properly imported and enabled in Unity.
We're enabling Lunar Console programmatically at runtime (i.e. no prefab exists in any scene) using the following code, this is what is throwing the exception above: