Problem with Spotlight

I made spotlights in my app, so when I’m using the app through kodular companion it works perfectly fine. But when I compile the app, it gives me this error whenever I open it.

java.lang.NullPointerException: Attempt to invoke virtual method ‘android.view.View com.google.appinventor.components.runtime.AndroidViewComponent.getView()’ on a null object reference
at com.google.appinventor.components.runtime.MakeroidSpotlight.ShowSpotlight(SourceFile:406)
at com.google.appinventor.components.runtime.MakeroidSpotlight.onOrientationChange(SourceFile:86)
at com.google.appinventor.components.runtime.Form.ScreenOrientationChanged(SourceFile:1068)
at com.google.appinventor.components.runtime.Form$1.run(SourceFile:608)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8319)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1038)

Any help?

1 Like

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun

1 Like

Thank you, but it worked. I don’t know how, I just left the app without opening it then it worked. Or May be I recompiled it. It worked anyway without any edits.

Thank you.