weixin_39605997
2020-12-29 01:34 阅读 0

Released unknown imageData reference

Sometimes crash the app with the message "Released unknown imageData reference".

the code:


                        mapRegion.Pins.Clear();
                        if (e.Result.Dados.ListaVagas != null)
                        {
                            foreach (VagaProximaDto item in e.Result.Dados.ListaVagas)
                            {
                                Pin clsPin = new Pin()
                                {
                                    Label = String.Format("Identificação da vaga: {0}", item.Identificacao),
                                    Position = new Position((Double)item.PosLatitude, (Double)item.PosLongitude),
                                    Type = PinType.Place,
                                    Icon = BitmapDescriptorFactory.FromView(new BindingPinView() { Status = item.Situacao, Display = item.Identificacao })
                                };
                                mapRegion.Pins.Add(clsPin);                                                                
                            }
                        }

The problem happen 'cause I have a property named by StatusColor (custom view) that change the color of my shape that I drew (my custom pin is a circle). The first time I open the map, works fine, the others crash the app.

stack tracer


java.lang.IllegalArgumentException: Released unknown imageData reference
maps.w.d.b(Unknown Source)
maps.ad.f.c(Unknown Source)
maps.ad.S.a(Unknown Source)
at aep.onTransact(:com.google.android.gms.DynamiteModulesB:204)
android.os.Binder.transact()Binder.java:326
com.google.android.gms.maps.model.internal.zzf$zza$zza.zzw(Unknown Source)
com.google.android.gms.maps.model.Marker.setIcon(Unknown Source)
mono.java.lang.RunnableImplementor.n_run(Native Method)
mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
android.os.Handler.handleCallback()Handler.java:615
android.os.Handler.dispatchMessage()Handler.java:92
android.os.Looper.loop()Looper.java:137
android.app.ActivityThread.main()ActivityThread.java:4921
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke()Method.java:511
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:1038
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:805
dalvik.system.NativeStart.main(Native Method)
Xamarin caused by: Java.Lang.IllegalArgumentException: Released unknown imageData reference
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<368820a9888f43ddb85d18e87189adbf>:0
Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference instance, JniMethodInfo method, JniArgumentValue* args)<a043032cf94a485190047a14918b9f60>:0
Android.Runtime.JNIEnv.CallVoidMethod(IntPtr jobject, IntPtr jmethod, JValue* parms)<cc8685588d4149c698e06056042bc413>:0
Android.Gms.Maps.Model.Marker.SetIcon(BitmapDescriptor icon)<cede2ee4138a48bb98b62dcaee115663>:0
Xamarin.Forms.GoogleMaps.Logics.Android.PinLogic.<transformxamarinviewtoandroidbitmap>d__23.MoveNext()<1b4ee31327bd44e6b035727910286a6e>:0
Android.App.SyncContext.<post>c__AnonStorey0.<>m__0()<cc8685588d4149c698e06056042bc413>:0
Java.Lang.Thread.RunnableImplementor.Run()<cc8685588d4149c698e06056042bc413>:0
Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)<cc8685588d4149c698e06056042bc413>:0
at (wrapper dynamic-method) System.Object:322146cd-46b8-4c41-83f9-930036dccf77 (intptr,intptr)
--- End of managed Java.Lang.IllegalArgumentException stack trace ---
java.lang.IllegalArgumentException: Released unknown imageData reference






</cc8685588d4149c698e06056042bc413></cc8685588d4149c698e06056042bc413></cc8685588d4149c698e06056042bc413></post></transformxamarinviewtoandroidbitmap></cede2ee4138a48bb98b62dcaee115663></cc8685588d4149c698e06056042bc413></a043032cf94a485190047a14918b9f60>

该提问来源于开源项目:amay077/Xamarin.Forms.GoogleMaps

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

9条回答 默认 最新

  • weixin_39943383 weixin_39943383 2020-12-29 01:34

    Same problem here.

    点赞 评论 复制链接分享
  • weixin_39789979 weixin_39789979 2020-12-29 01:34

    Could you try it with latest pre-release?

    点赞 评论 复制链接分享
  • weixin_39605997 weixin_39605997 2020-12-29 01:34

    Yes, I can. But it's not easy reproduce the problem.

    I think the problem is in Clear.

    This code run every 12 seconds.

    
    Device.BeginInvokeOnMainThread(() =>
                {
                    try
                    {
                        if (!String.IsNullOrEmpty(e.Result.Dados.Erro))
                        {
    
                        }
                        else
                        {
                            mapRegion.Pins.Clear();
                            if (e.Result.Dados.ListaVagas != null)
                            {
                                foreach (VagaProximaDto item in e.Result.Dados.ListaVagas)
                                {
                                    Pin clsPin = new Pin()
                                    {
                                        Label = String.Format("Identificação da vaga: {0}", item.Identificacao),
                                        Position = new Position((Double)item.PosLatitude, (Double)item.PosLongitude),
                                        Type = PinType.Place,
                                        Icon = item.Situacao != 1 ? BitmapDescriptorFactory.FromView(new BindingPinView(item.Identificacao)) : BitmapDescriptorFactory.FromView(new BindingPinDenyView(item.Identificacao)),
    
                                    };
    
                                    mapRegion.Pins.Add(clsPin);
                                }
                            }
                        }
                    }
                    catch
                    {
    
                    }
                });
    
    点赞 评论 复制链接分享
  • weixin_39789979 weixin_39789979 2020-12-29 01:34

    How about to not clear all pins but just update their positions / add missing / delete obsolete? st 4. 1. 2017 v 21:43 odesílatel Renan napsal:

    Yes, I can. But it's not easy reproduce the problem.

    I think the problem is in Clear

    `Device.BeginInvokeOnMainThread(() => { try { if (!String.IsNullOrEmpty(e.Result.Dados.Erro)) {

                }
                else
                {
                    mapRegion.Pins.Clear();
                    if (e.Result.Dados.ListaVagas != null)
                    {
                        foreach (VagaProximaDto item in e.Result.Dados.ListaVagas)
                        {
                            Pin clsPin = new Pin()
                            {
                                Label = String.Format("Identificação da vaga: {0}", item.Identificacao),
                                Position = new Position((Double)item.PosLatitude, (Double)item.PosLongitude),
                                Type = PinType.Place,
                                Icon = item.Situacao != 1 ? BitmapDescriptorFactory.FromView(new BindingPinView(item.Identificacao)) : BitmapDescriptorFactory.FromView(new BindingPinDenyView(item.Identificacao)),
    
                            };
    
                            mapRegion.Pins.Add(clsPin);
                        }
                    }
                }
            }
            catch
            {
    
            }
        });`
    

    — You are receiving this because you commented.

    Reply to this email directly, view it on GitHub https://github.com/amay077/Xamarin.Forms.GoogleMaps/issues/162#issuecomment-270481241, or mute the thread https://github.com/notifications/unsubscribe-auth/AV-OEhY6nk62OylIhKdc5mE9iIlvJgZYks5rPASEgaJpZM4LRxVr .

    点赞 评论 复制链接分享
  • weixin_39605997 weixin_39605997 2020-12-29 01:34

    I did it now. I will pay attention in next day, after that I tell you if it works. Thank for your help.

    点赞 评论 复制链接分享
  • weixin_39605997 weixin_39605997 2020-12-29 01:34

    Sometimes I got this problem now:

    
    Xamarin caused by: android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
    System.Collections.Generic.LinkedList<t>.InternalInsertNodeBefore(LinkedListNode<t> node, LinkedListNode<t> newNode)<d799cca53ec44d47a25250886b9af038>:0
    System.Collections.Generic.LinkedList<t>.AddLast(T value)<d799cca53ec44d47a25250886b9af038>:0
    Xamarin.Forms.GoogleMaps.Android.Utils.<>c__DisplayClass6_0.<convertviewtobitmapdescriptor>b__0()<1b4ee31327bd44e6b035727910286a6e>:0
    System.Threading.Tasks.Task<tresult>.InnerInvoke()<368820a9888f43ddb85d18e87189adbf>:0
    System.Threading.Tasks.Task.Execute()<368820a9888f43ddb85d18e87189adbf>:0
    Xamarin.Forms.GoogleMaps.Logics.Android.PinLogic.<transformxamarinviewtoandroidbitmap>d__23.MoveNext()<1b4ee31327bd44e6b035727910286a6e>:0
    Android.App.SyncContext.<post>c__AnonStorey0.<>m__0()<cc8685588d4149c698e06056042bc413>:0
    Java.Lang.Thread.RunnableImplementor.Run()<cc8685588d4149c698e06056042bc413>:0
    Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)<cc8685588d4149c698e06056042bc413>:0
    at (wrapper dynamic-method) System.Object:5dfaff6c-db10-42c6-b241-3431330886a3 (intptr,intptr)
    mono.java.lang.RunnableImplementor.n_run(Native Method)
    mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
    android.os.Handler.handleCallback()Handler.java:739
    android.os.Handler.dispatchMessage()Handler.java:95
    android.os.Looper.loop()Looper.java:135
    android.app.ActivityThread.main()ActivityThread.java:5296
    java.lang.reflect.Method.invoke(Native Method)
    java.lang.reflect.Method.invoke()Method.java:372
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:908
    com.android.internal.os.ZygoteInit.main()ZygoteInit.java:703
    </cc8685588d4149c698e06056042bc413></cc8685588d4149c698e06056042bc413></cc8685588d4149c698e06056042bc413></post></transformxamarinviewtoandroidbitmap></tresult></convertviewtobitmapdescriptor></d799cca53ec44d47a25250886b9af038></t></d799cca53ec44d47a25250886b9af038></t></t></t>
    点赞 评论 复制链接分享
  • weixin_39605997 weixin_39605997 2020-12-29 01:34

    I think your suggestion works. I remove each pin and add again. Thank you.

    点赞 评论 复制链接分享
  • weixin_39789979 weixin_39789979 2020-12-29 01:34

    interestin, any clear method should work also

    点赞 评论 复制链接分享
  • weixin_39661129 weixin_39661129 2020-12-29 01:34

    We have not received the requested information. If you are still experiencing this issue please provide all the requested information and re-open the issue report. Thanks!

    点赞 评论 复制链接分享

相关推荐