x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.20
Tags:
more ▼

asked Sep 30 '18 at 02:23 PM in C++ Programming

avatar image

SalihBalkan
419 15 26 55

avatar image Firefly74 Oct 01 '18 at 11:49 AM

More infos are needed, like what kind of crash ? Are any objects null in those you show/ use here ? do you have a stack trace that is usefull ?

avatar image SalihBalkan Oct 09 '18 at 01:07 PM

Only useless android.bat logs and this. I found the crashing line by putting UE_LOG to each line of the code. Bold line is crashing.

avatar image Shadowriver Oct 01 '18 at 12:16 PM

Did you do modifications in ProGuard config?

avatar image SalihBalkan Oct 09 '18 at 01:07 PM

I didn't change anything since 4.15.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Jan 04 '19 at 05:18 AM

avatar image

SalihBalkan
419 15 26 55

(comments are locked)
10|2000 characters needed characters left

try to add as much debug line as you can, like :

 if(!env)
     UE_LOG("envNULL");

i've never used jmethodID nor jobject, but check their validity too with a log, could give more idea why it's crashing :/

more ▼

answered Oct 09 '18 at 01:23 PM

avatar image

Firefly74
1.3k 13 15 30

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question