summaryrefslogtreecommitdiff
path: root/Source/Android/jni/MainAndroid.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-05-01 10:40:17 +0200
committerJosJuice <josjuice@gmail.com>2026-05-08 10:56:51 +0200
commit4470534dc594532714768586c2041d27476ae77f (patch)
treebb35e07d7cfa4c3df52a54a5b0ec705a98c8e7bf /Source/Android/jni/MainAndroid.cpp
parentd19952cc113940391ebcf264ced7ddc56310ba75 (diff)
Android: Move alert message log from Kotlin to C++
For some reason, NativeLibrary.kt calling Log for the alert message text makes Dolphin die with a JNI error. Supposedly the jstring passed to the logging function is invalid. I don't understand why, because the dialog that we show right afterwards is able to read the string just fine. The error happens even if I pass the string directly to Log without prepending any extra text. There's no real downside to having the logging in C++ instead of Kotlin, so let's move it to C++ to avoid the JNI error.
Diffstat (limited to 'Source/Android/jni/MainAndroid.cpp')
-rw-r--r--Source/Android/jni/MainAndroid.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp
index 3855cb4c18..a25d4a1d4a 100644
--- a/Source/Android/jni/MainAndroid.cpp
+++ b/Source/Android/jni/MainAndroid.cpp
@@ -202,6 +202,8 @@ std::unique_ptr<GBAHostInterface> Host_CreateGBAHost(std::weak_ptr<HW::GBA::Core
static bool MsgAlert(const char* caption, const char* text, bool yes_no, Common::MsgType style)
{
+ __android_log_print(ANDROID_LOG_ERROR, DOLPHIN_TAG, "[NativeLibrary] Alert: %s", text);
+
JNIEnv* env = IDCache::GetEnvForThread();
jstring j_caption = ToJString(env, caption);