Crash at C++ line: CallObjectMethod(...);
Bold line below was working fine in 4.15. However, this line is crashing in 4.20:
JNIEnv* env = FAndroidApplication::GetJavaEnv();
jobject activity = FAndroidApplication::GetGameActivityThis();
jmethodID mid = env->GetMethodID(env->GetObjectClass(activity), "getSystemService", "(Ljava/lang/String;)Ljava/lang/Object;");
jobject wifi_manager = env->CallObjectMethod(activity, mid, env->NewStringUTF("wifi"));
What is wrong with this line and how can I fix this?
This was because of missing runtime permission. You can search for the relevant permission by searching 'permission' in monitor bat logs. Since mandatory runtime permission to get a static device id, we had to switch to dynamic device id that may change at reinstall, proved by 'Get Device Identifier' node.
try to add as much debug line as you can, like :
i've never used jmethodID nor jobject, but check their validity too with a log, could give more idea why it's crashing :/
answered Oct 09 '18 at 01:23 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here