Closed
Description
Xamarin android version included in latest VS Preview does not handle generic RecyclerView Adapters.
Check attached test project. Everything runs fine from current stable version of VS.
Steps to Reproduce
- Create generic RecyclerView.Adapter
- Set it as adapter to RecyclerView
- Observe crash on runtime without stacktrace
Expected Behavior
Everything runs fine
Actual Behavior
App crashes without output or catching exception in debug
Version Information
Microsoft Visual Studio Community 2017 Preview (2)
Version 15.6.0 Preview 2.0
VisualStudio.15.Preview/15.6.0-pre.2.0+27309.0
Microsoft .NET Framework
Version 4.7.02556
Installed Version: Community
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jonpryor commentedon Jan 12, 2018
I am unable to reproduce a crash on a Pixel 2 running Android 8.0.
However, I do observe the following message in
adb logcat
:If I try to search for the above, a stackoverflow response comes up, and from a quick reading of the answer I think your repro project is incomplete. For example, you don't have a
<android.support.v7.widget.RecyclerView/>
element withinResources\layout\Main.axml
.I also don't understand how the repro is supposed to work:
Resource.Layout.Main
is just a<LinearLayout/>
which doesn't do anything with theRecyclerView
instance created in the constructor.I don't understand how this is supposed to work in the first place.
erikpowa commentedon Jan 13, 2018
I had similar issues or the same with the xamarin.android that came with the 15.6.0 Preview 2.0, maybe it was 8.1.3.0?
Here is my old repro proj App9.csproj.zip but it's fixed since then.
As I remember it's not reproducible anymore since 8.2.0.6? (sdk) version.
The exception was something like the xamarin.android tried to create and instance of an abstract "Base
Adapter" class instead of the derived.
ctrl-shift commentedon Jan 15, 2018
@jonpryor This is just a simplest repro project that crashes for me on latest VS preview but not on stable.
I've got the same issue in multiple places in a rather large app.
Looked a bit more into the logs of the app, found:
F/art ( 3928): art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: can't make objects of type android.support.v7.widget.RecyclerView$Adapter: 0x12c2cc80 F/art ( 3928): art/runtime/java_vm_ext.cc:470] in call to AllocObject ...
Checked Xamarin.Android version on VS preview - it's 8.2.0.1 (HEAD/1e47e7ed5), so it might be the version with the issue @erikpowa mentioned. Is there any way to update Xamarin.Android in VS preview without waiting for whole VS update, so I can check if issue is resolved at 8.2.0.6?
erikpowa commentedon Jan 15, 2018
@ctrl-shift jenkins. But prepare for other bugs. You can roll back (revert) whenever you want from VS Extensions.
@ctrl-shift Yeah, this is what I had before 8.2.0.6 so I'm pretty sure it's fixed already.
ctrl-shift commentedon Jan 15, 2018
Updated to 8.2.0.6 and I can no longer reproduce this anywhere.
I suppose issue can be closed.
jonpryor commentedon Jan 16, 2018
Closing.
Bump to xamarin/monodroid/main@ed584c77
Bump to xamarin/monodroid@ff633623e; fastdev ALL localizations (#5785)