question

LeonardHarris-3315 avatar image
0 Votes"
LeonardHarris-3315 asked LeonardHarris-3315 action

Android Binding Library - Java.Lang.NoClassDefFoundError: Failed resolution of: Lsqip/internal/R$attr; ---> Java.Lang.ClassNotF

Trying finish off creating a binding library and have run into an exception that I cant seem to figure out how to solve.

Bassically the Binding library makes use of some resources to display a CardEntryActivity, I have checked for the correct xml file for the sqip_activity_card_entry which exists, I have a internal CardEntry binding library (jar) project that references another CardEntry binding library (aar) project with the resources needed and the Internal CardEntry is being referenced for by the CardEntry Binding Library project. I checked the .pom file and added the dependencies required but why am I getting this issue, I cannot understand how to fix or get it to correct inflate the layout??

The whole exception is:

csharp
[AndroidRuntime] Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lsqip/internal/R$attr;
[AndroidRuntime] Caused by: android.view.InflateExcep03-16 18:49:23.538 E/AndroidRuntime(10815):     at sqip.internal.CreditCardEditor.<init>(CreditCardEditor.kt:108)
[AndroidRuntime]     ... 30 more
[AndroidRuntime] Caused by: java.lang.ClassNotFoundException: Didn't find class "sqip.internal.R$attr" on path: DexPathList[[zip file "/data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/base.apk"],nativeLibraryDirectories=[/data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/lib/x86, /data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
[AndroidRuntim03-16 18:49:23.538 E]     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
[AndroidRuntime]     at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[AndroidRuntime]     ... 31 more
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_object_method'.
[Mono] Probing 'java_interop_jnienv_call_object_method'.
[Mono] Found as 'java_interop_jnienv_call_object_method'.
**Java.Lang.RuntimeException:** 'Unable to start activity ComponentInfo{com.companyname.test/sqip.internal.CardEntryActivity}: android.view.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor'

[Mono] DllImport attempting to load: '/system/lib/liblog.so'.
[Mono] DllImport loaded library '/system/lib/liblog.so'.
[Mono] DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
[Mono] Searching for '__android_log_print'.
[Mono] Probing '__android_log_print'.
[Mono] Found as '__android_log_print'.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.RuntimeException: Unable to start activity ComponentInfo{com.companyname.test/sqip.internal.CardEntryActivity}: android.view.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor ---> Android.Views.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor ---> Android.Views.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor ---> Java.Lang.Reflect.InvocationTargetException: Exception of type 'Java.Lang.Reflect.InvocationTargetException' was thrown. ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Lsqip/internal/R$attr; ---> Java.Lang.ClassNotF
[MonoDroid]    --- End of inner exception stack trace ---
[chatty] uid=10135(com.companyname.test) identical 3 lines
[MonoDroid]    --- End of inner exception stack trace ---
[MonoDroid]   --- End of managed Java.Lang.RuntimeException stack trace ---
[MonoDroid] java.lang.RuntimeException: Unable to start activity ComponentInfo{com.companyname.test/sqip.internal.CardEntryActivity}: android.view.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor
[MonoDroid]     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
[MonoDroid]     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
[MonoDroid]     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[MonoDroid]     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
[MonoDroid]     at android.os.Handler.dispatchMessage(Handler.java:107)
[MonoDroid]     at android.os.Looper.loop(Looper.java:214)
[MonoDroid]     at android.app.ActivityThread.main(ActivityThread.java:7356)
[MonoDroid]     at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid]     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[MonoDroid]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
[MonoDroid] Caused by: android.view.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor
[MonoDroid] Caused by: android.view.InflateException: Binary XML file line #1 in com.companyname.test:layout/sqip_activity_card_entry: Error inflating class sqip.internal.CreditCardEditor
[MonoDroid] Caused by: java.lang.reflect.InvocationTargetException
[MonoDroid]     at java.lang.reflect.Constructor.newInstance0(Native Method)
[MonoDroid]     at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
[MonoDroid]     at android.view.LayoutInflater.createView(LayoutInflater.java:854)
[MonoDroid]     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
[MonoDroid]     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
[MonoDroid]     at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
[MonoDroid]     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
[MonoDroid]     at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
[MonoDroid]     at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
[MonoDroid]     at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
[MonoDroid]     at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
[MonoDroid]     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
[MonoDroid]     at sqip.internal.CardEntryActivity.doSetContentView(CardEntryActivity.kt:52)
[MonoDroid]     at sqip.internal.BaseCardEntryActivity.onCreate(BaseCardEntryActivity.kt:135)
[MonoDroid]     at sqip.internal.CardEntryActivity.onCreate(CardEntryActivity.kt:38)
[MonoDroid]     at android.app.Activity.performCreate(Activity.java:7802)
[MonoDroid]     at android.app.Activity.performCreate(Activity.java:7791)
[MonoDroid]     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
[MonoDroid]     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
[MonoDroid]     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
[MonoDroid]     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
[MonoDroid]     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
[MonoDroid]     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
[MonoDroid]     at android.os.Handler.dispatchMessage(Handler.java:107)
[MonoDroid]     at android.os.Looper.loop(Looper.java:214)
[MonoDroid]     at android.app.ActivityThread.main(ActivityThread.java:7356)
[MonoDroid]     at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid]     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
[MonoDroid]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
[MonoDroid] Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lsqip/internal/R$attr;
[MonoDroid]     at sqip.internal.CreditCardEditor.<init>(CreditCardEditor.kt:108)
[MonoDroid]     ... 30 more
[MonoDroid] Caused by: java.lang.ClassNotFoundException: Didn't find class "sqip.internal.R$attr" on path: DexPathList[[zip file "/data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/base.apk"],nativeLibraryDirectories=[/data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/lib/x86, /data/app/com.companyname.test-HJ1094nZPMw0-WXEaMJQGw==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
[MonoDroid]     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
[MonoDroid]     at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
[MonoDroid]     at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
[MonoDroid]     ... 31 more
[MonoDroid] 
[Process] Sending signal. PID: 10815 SIG: 9


The xml layout

77977-111261282-1d95de00-8687-11eb-8c71-eb94515bf879.png

Class file that handles the xml:

77976-capture.png

dotnet-xamarin
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You can try to check the build action of the jar, if the build action is EmbeddedReferenceJar, so that it is included in the final binding assembly. In addition, could you please post a basic demo so that we can help you better?

0 Votes 0 ·

@LeonardHarris-3315 did you figure out what the issue was here?

0 Votes 0 ·

0 Answers