Intermittent error message

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
About one time in 4 or 5 compiling/loading my app onto a device in Debug mode, I get the B4A error message in the IDE: "Object reference not set to an instance of an object." If I quit and try again, it will load and run without the message.

I don't know what kind of object it is referring to, but I haven't added any new variables or Views since installing the latest version of B4A. I've just been tracking down bugs in my code.
 

moster67

Expert
Licensed User
Longtime User
Happens to me as well but not always. In this moment, I can't recall under which circumstances but I will make a note of it next time it happens and report.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Does this message appear in the compilation window?

It is in a separate, floating message box with "Basic4Android" on the title bar. It comes up when I press F5 and about the same time as the "successful installation" message. IOW, the app installs and will run, but Debug never connects. The little connect icon on Debug keeps saying "connecting".

I've had it happen another time or two since my original post, but since it doesn't come up again when I simply close the app and press F5 again, there's no way to get a handle on what's causing it. I don't *how* you can track this down.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've compiled (F5) at least a half-dozen times (maybe 8-10) without an error, then it just came up again. I closed the error window, clicked the stop button on Debug, pressed F5 again, and it loaded and ran fine.

ObjRefNotSet.JPG
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please try the following steps:
1. Make sure that you have a folder named c:\temp.
2. Run Basic4android with a shortcut or from the command line and add the argument: -log

It should create a file named c:\temp\log.txt.
When this error appears, close the IDE. The log should contain more information about this error.
 

moster67

Expert
Licensed User
Longtime User
I still get this error occasionally.

I will now set up a folder called c:\temp and run B4A with the log-command and see if I can get some more information about this error.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Maybe it is an Heisenbug...

Yeah, I had a lot of fun tracking down a Heisenbug yesterday. The computer would make a wrong choice, so I would put in a Debug break and step through and it would make the right choice. (Rinse, repeat a bunch of times.)

Turned out that a random number factor I had in a particular sub was getting applied to a variable in error. Just prior to finding that, I was getting ready to rip you a new one for putting out such a buggy development system. :rolleyes:
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Well, I was about to give up on ever getting the error message again, and up it came. When the error came up, I closed the app and quit B4A so that I could copy the log.txt file. I then ran it again and it loaded okay with no changes. (I wish I had thought to run it again before copying log.txt, but I don't think it would have told you anything not already in the file.

The log.txt file is pretty long, so I couldn't attach it. Here's a link to it: http://www.hsv-life.com/log.txt.

Here's the last few lines:

LogCat process: 69264
OptimizedDexer exitCode=1
dontWait=False
optimizedDex receive: 33
OptimizedDexer exitCode=0
Optimized worked...
System.NullReferenceException: Object reference not set to an instance of an object.
at a1.a()
at e.a(Object A_0)
OptimizedDexer exitCode=-1
dontWait=False
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I know you said that you believe you already found the error, but I just had it happen again and this time it has a lot more info with it, so I'm passing it along just in case. This time I remembered to run it again before quitting and as usual, it loaded fine the 2nd time. I then quit and copied the following from the end of Log.txt:

B4X:
 LogCat process: 32560
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at bj.a(c A_0, Dictionary`2 A_1)
   at bj.a(az A_0, List`1 A_1, ai A_2, c& A_3)
System.Exception: Unknown type: b
Are you missing a library reference?
   at at.a(String A_0, Boolean A_1)
   at bj.a(c A_0, Dictionary`2 A_1)
   at bj.a(az A_0, List`1 A_1, ai A_2, c& A_3)
optimizedDex receive: 33
OptimizedDexer exitCode=0
Optimized worked...
a
OptimizedDexer exitCode=1
dontWait=False
OptimizedDexer exitCode=1
dontWait=False
System.Exception: Unknown type: ion
Are you missing a library reference?
   at at.a(String A_0, Boolean A_1)
   at bj.a(c A_0, Dictionary`2 A_1)
   at bj.a(az A_0, List`1 A_1, ai A_2, c& A_3)
System.Exception: Unknown type: as
Are you missing a library reference?
   at at.a(String A_0, Boolean A_1)
   at bj.a(c A_0, Dictionary`2 A_1)
   at bj.a(az A_0, List`1 A_1, ai A_2, c& A_3)
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at bj.a(c A_0, Dictionary`2 A_1)
   at bj.a(az A_0, List`1 A_1, ai A_2, c& A_3)
optimizedDex receive: 33
OptimizedDexer exitCode=0
Optimized worked...
System.NullReferenceException: Object reference not set to an instance of an object.
   at a1.a()
   at e.a(Object A_0)
optimizedDex receive: 33
OptimizedDexer exitCode=0
Optimized worked...
a
 

ajk

Active Member
Licensed User
Longtime User
I got the error as follows:

.Net version: 4.0.30319.2012
Gui: 999
B4XClassifer created
B4XErrorTagger created
Gui: 1000
Gui: 1000
Gui: 1000
*** no reuse ***
Gui: 768
Gui: 1000
Gui: 1000
ExitCode: 0
Output:

Error:

Gui: 1000
B4XClassifer created
B4XErrorTagger created
B4XClassifer created
B4XErrorTagger created
B4XClassifer created
B4XErrorTagger created
B4XClassifer created
B4XErrorTagger created
B4XClassifer created
B4XErrorTagger created
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
*** no reuse ***
Gui: 1180
B4XClassifer created
Compilation task: 906.25
Gui: 63
Gui: 780
optimizedDex receive: 33
OptimizedDexer exitCode=0
Optimized worked...
Compilation task: 64515.625

Trying to connect to port: 59712
Gui: 133
RD e: java.lang.UnsupportedClassVersionError: anywheresoftware/b4a/pc/RDebug$IRemote : Unsupported major.minor version 51.0
RD e: at java.lang.ClassLoader.defineClass1(Native Method)
RD e: at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
RD e: at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
RD e: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
RD e: at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
RD e: at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
RD e: at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
RD e: at java.security.AccessController.doPrivileged(Native Method)
RD e: at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
RD e: at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
RD e: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
RD e: at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
RD e: at java.lang.ClassLoader.defineClass1(Native Method)
RD e: at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
RD e: at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
RD e: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
RD e: at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
RD e: at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
RD e: at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
RD e: at java.security.AccessController.doPrivileged(Native Method)
RD e: at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
RD e: at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
RD e: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
RD e: at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
RD e: Could not find the main class: prak.spk.main. Program will exit.
RD e: Exception in thread "main"
ExitCode: 1
Output:

Error:

OptimizedDexer exitCode=-1
dontWait=False
Gui: 454
 

iCAB

Well-Known Member
Licensed User
Longtime User
Rapid Debugger Failed to Connect.
B4A 5.20 , Java ver 8
Please see attached log

Thanks in advance
 

Attachments

  • RapidDebuggerFailedToConnect.txt
    406.6 KB · Views: 1,171
Top