-
-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work on android with unity 2023.1 #218
Comments
Same problem. Android app crashes on launch with error: Unity 2023.1.3 |
Yep, same problem. Any solution? |
Same problem |
The issue happens because the native NOTE: lunar-console.zip - Drag & drop the package spacemadness.com.lunarconsole.console;
import android.app.Activity;
import android.view.View;
import com.unity3d.player.UnityPlayer;
import java.lang.reflect.Field;
import java.util.Map;
import spacemadness.com.lunarconsole.debug.Log;
import static spacemadness.com.lunarconsole.debug.Tags.PLUGIN;
public class ManagedPlatform implements Platform {
private final UnityScriptMessenger scriptMessenger;
public ManagedPlatform(String target, String method) {
scriptMessenger = new UnityScriptMessenger(target, method);
}
@Override
public View getTouchRecipientView() {
Activity activity = UnityPlayer.currentActivity;
if (activity == null) {
Log.e(PLUGIN, "UnityPlayer.currentActivity is null");
return null;
}
UnityPlayer unityPlayer = null;
try {
Field unityPlayerField = activity.getClass().getDeclaredField("mUnityPlayer");
unityPlayerField.setAccessible(true);
unityPlayer = (UnityPlayer) unityPlayerField.get(activity);
} catch (Exception e) {
Log.e(PLUGIN, "Error while getting UnityPlayer instance: %s", e);
}
if (unityPlayer == null) {
Log.e(PLUGIN, "UnityPlayer instance is null");
return null;
}
return unityPlayer.getFrameLayout();
}
@Override
public void sendUnityScriptMessage(String name, Map<String, Object> data) {
try {
scriptMessenger.sendMessage(name, data);
} catch (Exception e) {
Log.e(PLUGIN, "Error while sending Unity script message: name=%s param=%s", name, data);
}
}
} |
After this fix, the console now works on Android for me, but I receive nonstop errors: Using Unity 6 LTS and Samsung Galaxy S9. Any ideas? |
Updated to Unity 6 (6000.0.31f1) and it fixed my issues. |
@dogramacigokhan I think the issue here is that Unity changed who inputs are read. Maybe its also something on the android side as well. In any case, if anyone has some straight forward advice how to fix at least the crashing on the pro I'd be happy. |
If you are concerend with liability - I tried sending a mail to @weeeBox but his gmail returns
|
"failed to verify android.view.view spacemadness.com.lunarconsole.console"
The text was updated successfully, but these errors were encountered: