0

I want to change the reference object during debug. For example, I have a String object and I want assign it another value. When I change it with "Set Value... (F2)", the debugger shows a new value. But when I try to call some method (like myString.length()) after modifying the value, a NullPointerException is raised. It seems that new instance is null or the reference is wrong. The same thing happens when "Evaluate Expression".

The problem is present on Android > 5.0 (tested on emulators and real devices). For android 4.* it works good. I thought maybe it is because of ART, but on android 4.4 with ART it worked ok. I also disabled AOT compilation with 'android:vmSafeMode="true"', but it didn't help.

There is no problem with value types or class members reference objects, but only with local variable reference objects.

I tried on different PCs using Android Studio 141.2288178, sdk r24.4.1, Ubuntu. Also I tried to debug with jdwp but no results.

Va Ko
  • 11
  • 3

0 Answers0