ThinkGeo.com    |     Documentation    |     Premium Support

TileOverlay crash while loading

Hi,

I am facing issue where sometimes when I launch the application map tries to load and throws the exception when loading google map overlay

TileOverlay+<>c_DisplayClass58_0.b_0()
Java.Lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup

how to handle it since this error crashes my application. I am using Xamarin forms and this is happening on android platform

Thanks

Hi @Thenishreddy,

I’ve never received this error in the past. Are you getting this error on the ‘HowDoI’ samples, or a custom application that you’re working on?

Also, can you send us the full stack trace of the exception?

Thanks,
John

Getting it on custom application here is the full stack trace

Xamarin Exception Stack:
Java.Lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup
at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in :0
at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00076] in :0
at Android.Views.ViewGroup.AddView (Android.Views.View child) [0x00031] in <8638e88f61db46e4bc35e66b77e3b3e8>:0
at ThinkGeo.UI.Android.TileOverlay+<>c__DisplayClass58_0.b__0 () [0x000ee] in :0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <8638e88f61db46e4bc35e66b77e3b3e8>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <8638e88f61db46e4bc35e66b77e3b3e8>:0
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V (_JniMarshal_PP_V callback, System.IntPtr jnienv, System.IntPtr klazz) [0x00005] in <8638e88f61db46e4bc35e66b77e3b3e8>:0
at java.lang.IllegalArgumentException: Cannot add a null child view to a ViewGroup
at android.view.ViewGroup.addView(ViewGroup.java:4431)
at android.view.ViewGroup.addView(ViewGroup.java:4413)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6780)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390)

Thread 3399:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:150)
2 java.lang.Thread.run(Thread.java:762)

Thread 3400:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Object.wait(Object.java:407)
2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
4 java.lang.Daemons$FinalizerDaemon.run(Daemons.java:204)
5 java.lang.Thread.run(Thread.java:762)

Thread 3401:
0 java.lang.Thread.sleep(Thread.java:-2)
1 java.lang.Thread.sleep(Thread.java:371)
2 java.lang.Thread.sleep(Thread.java:313)
3 java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:314)
4 java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:336)
5 java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:253)
6 java.lang.Thread.run(Thread.java:762)

Thread 3402:
0 dalvik.system.VMRuntime.runHeapTasks(VMRuntime.java:-2)
1 java.lang.Daemons$HeapTaskDaemon.run(Daemons.java:433)
2 java.lang.Thread.run(Thread.java:762)

Thread 3413:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:323)
2 android.os.Looper.loop(Looper.java:136)
3 android.os.HandlerThread.run(HandlerThread.java:61)

Thread 3415:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2128)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.park(LockSupport.java:161)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2035)
5 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1058)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:762)

Thread 3416:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:323)
2 android.os.Looper.loop(Looper.java:136)
3 android.os.HandlerThread.run(HandlerThread.java:61)

Thread 3417:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2128)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
5 java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:438)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1057)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:762)

Thread 3418:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2128)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
5 java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:438)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1057)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:762)

Thread 3421:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2128)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
5 java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:438)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1057)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:762)

Thread 3422:
0 java.lang.Object.wait(Object.java:-2)
1 com.android.okhttp.okio.AsyncTimeout.awaitTimeout(AsyncTimeout.java:323)
2 com.android.okhttp.okio.AsyncTimeout.-wrap0(AsyncTimeout.java:-1)
3 com.android.okhttp.okio.AsyncTimeout$Watchdog.run(AsyncTimeout.java:286)

Thread 3425:
0 java.lang.Object.wait(Object.java:-2)
1 com.android.okhttp.ConnectionPool.performCleanup(ConnectionPool.java:319)
2 com.android.okhttp.ConnectionPool.runCleanupUntilPoolIsEmpty(ConnectionPool.java:256)
3 com.android.okhttp.ConnectionPool.-wrap0(ConnectionPool.java:-1)
4 com.android.okhttp.ConnectionPool$1.run(ConnectionPool.java:102)
5 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
6 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
7 java.lang.Thread.run(Thread.java:762)

Thread 3427:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Thread.parkFor$(Thread.java:2128)
2 sun.misc.Unsafe.park(Unsafe.java:325)
3 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:201)
4 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2077)
5 java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:438)
6 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1057)
7 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1118)
8 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
9 java.lang.Thread.run(Thread.java:762)

Thanks for the details, @Thenishreddy. I’ve been unable to recreate the issue.

Are you able to create a very simple sample that exhibits the error and upload the solution as a .zip file attachment to this post?

Thanks,
John