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.

Binding AAR library that contains AndroidX cause "NoClassDefFoundError" for "androidx/lifecycle/LifecycleOwner"

See original GitHub issue

Xamarin.Android Version (eg: 6.0):

Xamarin.Android SDK 9.1.7.0 (HEAD/ba9da7a76) Xamarin.Android Reference Assemblies and MSBuild support.

Operating System & Version (eg: Mac OSX 10.11):

Windows 10

Microsoft Visual Studio Professional 2017 Version 15.9.16 VisualStudio.15.Release/15.9.16+28307.858 Microsoft .NET Framework Version 4.8.03752

Support Libraries Version (eg: 23.3.0):

Xamarin.AndroidX.Lifecycle.Common v2.0.0-preview02

Describe your Issue:

Trying to create an AAR binding library that migrated to AndroidX (written in Java, using class androidx.lifecycle.LifecycleOwner), previously using support library and compiling correctly.

Xamarin.AndroidX.Lifecycle.Common dependency is added to the binding project, however still encountering the following error log: https://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/androidx-error.txt

4>JARTOXML : warning J2XA006: missing class error was raised while reflecting com.pdftron.pdf.controls.AnnotationToolbar : androidx/lifecycle/LifecycleOwner
4>  java.lang.NoClassDefFoundError: androidx/lifecycle/LifecycleOwner (TaskId:138)
4>    at java.lang.ClassLoader.defineClass1(Native Method) (TaskId:138)
4>    at java.lang.ClassLoader.defineClass(ClassLoader.java:760) (TaskId:138)
4>    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) (TaskId:138)

Steps to Reproduce (with link to sample solution if possible):

Download the sample project, open solution “\projectSrc\PDFNetAndroidXamarin\PDFNetAndroidXamarin.sln” Clean and build “PDFViewCtrlTools” project.

Link to sample: http://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/to-Xamarin.zip

Include any relevant Exception Stack traces, build logs, adb logs:

https://pdftron.s3.amazonaws.com/custom/external/xamarin/androidx/androidx-error.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
moljaccommented, Dec 6, 2019

@sgong-pdftron No need to be sorry. Git happens.

I’ll check that.

1reaction
moljaccommented, Nov 20, 2019

@sgong-pdftron Thanks for feedback.

Would it be possible if you could give it another try? Thanks!

Of course. Just, we are (I am) trying to launch AndroidX release 1st. I hope I wll come to this issue in next few days.

@matheussouza97 Thanks for the feedback. Appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - java.lang.NoClassDefFoundError for an aar library
I used to import aar libraries as modules and they worked flawlessly. I have just updated Android Studio to Arctic Fox and the...
Read more >
Troubleshooting Bindings - Xamarin
This article summarizes serveral common errors that may occur when generating bindings, along with possible causes and suggested ways to resolve ...
Read more >
Binding an .AAR - Xamarin
This walkthrough provides step-by-step instructions for creating a Xamarin.Android Java Bindings Library from an Android .AAR file.
Read more >
MPP: AAR dependency causes NoClassDefFoundError
Using the AAR dependency will not bring the transitive dependencies along, as the AAR doesn't include the transitive dependency classes nor contains any ......
Read more >
AAR library with Kotlin
Hi, I wrote a library in Kotlin, then I put the AAR files in unity project, build APK and run on my android...
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