question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with FastRenderer

See original GitHub issue

I got an exception while trying to use Glidex.Forms alongside FastRenderers_Experimental flag in Xamarin.Forms

here is a scenario which bug happens both PageA and PageB contains some images and we have enabled FastRenderer in android.

  1. Applications starts in PageA
  2. Navigate to PageB
  3. Navigate back to PageA
  4. Navigate to PageB again. the exception will be thrown here

Xamarin Exception Stack:

System.NotSupportedException: Unable to activate instance of type Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer from native handle 0xff892f3c (key_handle 0xfc8cb10).
  at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00182] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at Java.Lang.Object.GetObject (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type type) [0x000c1] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at Java.Lang.Object._GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00017] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at Java.Lang.Object.GetObject[T] (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00000] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at Java.Lang.Object.GetObject[T] (System.IntPtr jnienv, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00006] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at Android.Views.View.n_Invalidate (System.IntPtr jnienv, System.IntPtr native__this) [0x00000] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.58(intptr,intptr)
--- End of inner exception stack trace ---
  System.MissingMethodException: No constructor found for Xamarin.Forms.Platform.Android.FastRenderers.ImageRenderer::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership)
    at Java.Interop.TypeManager.CreateProxy (System.Type type, System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer) [0x00055] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
    at Java.Interop.TypeManager.CreateInstance (System.IntPtr handle, Android.Runtime.JniHandleOwnership transfer, System.Type targetType) [0x00116] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  --- End of inner exception stack trace ---
    Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.
      at Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.
      at java.lang.Error: Java callstack:
      at md5f92e0daf340890c9667469657ee2ece8.ImageRenderer.n_invalidate(Native Method)
      at md5f92e0daf340890c9667469657ee2ece8.ImageRenderer.invalidate(ImageRenderer.java:54)
      at android.widget.ImageView.setImageDrawable(ImageView.java:573)
      at com.bumptech.glide.request.target.DrawableImageViewTarget.setResource(DrawableImageViewTarget.java:28)
      at com.bumptech.glide.request.target.DrawableImageViewTarget.setResource(DrawableImageViewTarget.java:10)
      at com.bumptech.glide.request.target.ImageViewTarget.setResourceInternal(ImageViewTarget.java:127)
      at com.bumptech.glide.request.target.ImageViewTarget.onResourceReady(ImageViewTarget.java:104)
      at com.bumptech.glide.request.SingleRequest.onResourceReady(SingleRequest.java:579)
      at com.bumptech.glide.request.SingleRequest.onResourceReady(SingleRequest.java:549)
      at com.bumptech.glide.load.engine.EngineJob.handleResultOnMainThread(EngineJob.java:218)
      at com.bumptech.glide.load.engine.EngineJob$MainThreadCallback.handleMessage(EngineJob.java:324)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:193)
      at android.app.ActivityThread.main(ActivityThread.java:6680)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DragonTMcommented, Apr 6, 2021

@raulandresduque, we have no identified the difference or a root cause on how those builds are different. The build scripts looks like this msbuild $AndroidXamarinProjPath -t:UpdateAndroidResources -t:SignAndroidPackage -p:OutputPath=$OutputFolder/ -p:Configuration=Release -p:AndroidKeyStore=true -p:AndroidSigningKeyAlias=Alias -p:AndroidSigningKeyPass=pass -p:AndroidSigningKeyStore=$KeystoreFileNamePath -p:AndroidSigningStorePass=pass

I hope it will help you as well

0reactions
jonathanpepperscommented, Apr 8, 2021

SignAndroidPackage is the target that creates an .apk file and signs it.

I don’t think there is a reason to ever use UpdateAndroidResources.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fastrender seems to miss changes on some pages - support
Using the new 'fastrender' feature seems to cause an issue on a website I am working on. I use bootstrap as framework and...
Read more >
FastRenderer.js - What is It? How Do I Fix It?
Most of your FastRenderer.js problems should be resolved if the file is placed in the correct file path directory, but it's a good...
Read more >
Unable to activate instance of type Xamarin.Forms.Platform ...
I am having a issue with a Android app when I click a button that talks to the webservice ... Have you try...
Read more >
[Resolved] Why Subscribe to something that is not in the ...
This was an execution order issue that happened when FastRender.onPageLoad was called within a Meteor.startup block. As of V4, via 3a78e3254, ...
Read more >
communitypackages:fast-render
Fast Render. Fast Render is back! Fast Render can improve the initial load time of your app, giving you 2-10 times faster initial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found