Android IDE (AIDE) Support Forum

"Can not view the layout" error in string lesson

Hello,

I’ve installed AIDE on my android phone (OnePlus 8 Pro, Android 11), and the first lessons proceeded smoothly until the string lesson.

The first run (with the text of the Texview hardcoded in the main.xml file) displays the application, but when I replace the text by “@string/hi_text”, as per lesson’s instructions, I’m greeted by a congratulations popup on top of an error message!

The layout isn’t displayed at all, all I get is a blank screen with a “Can not view the layout. Attempt to invoke interface method ‘java.lang.Object java.util.Map.get(java.lang.Object)’ on a null object reference”.

From what I could google, this looks like a null pointer issue, but then the code is simple and the IDE confirms that I didn’t make any typo, so I’m clueless as to what could cause this…

I tried to uninstall & reinstall AIDE to no avail. Skipping this lesson doesn’t help either, the following lesson on background images gives me the same error message.

Also, I’ve checked that the file access permissions are granted for AIDE.!

If anyone here has advices of things to check or explanations to this behavior, I’d be grateful!

Thanks in advance for your help, and good coding to you.

Screenshot_20201107-153218_1|690x475

I’m pretty sure the problem is within your activity.java , let us take a look over that

I’d very much like to have a look at activity.java, but how do you get access to the file? The IDE only let me access main.xml and strings.xml files during the lesson… I’ll have a look using a file manager to see if I can find where those files are stored, maybe I’ll find the activity.java one there?

Well, let me tell you that you are doing a good job, but you gotta know that it is just a lesson and that’s probably a bug.
If you wanna test what you learned, create a new project and make the changes as you please. Go to "Code ‘for experts’ " and then on New Android app, it will create a simple main.xml and main_activity.java file then you can test what you did in the lesson, Im sure you won’t get that error .