I have created a Xamarin.Android binding of the Salesforce SDK, and its dependencies. I can successfully generate the dlls from the binding project and access all the APIs from the native source. But, when I try to initialise the Salesforce SDK using the following code, I am getting runtime exception without having proper information.
Initialisation code.SmartStoreSDKManager.InitNative(MainActivity.Instance, Java.Lang.Class.FromType(typeof(MainActivity)));
Exception
I was trying to figure it out from the native source, but I could not identify any code that cause this problem.
Answers
For this error, try to add the library to the application project (.csproj). .JAR files are not automatically resolved. A Java library binding is not always generated against a user assembly that does not exist in the target device or emulator.
Check the tutorial:
https://docs.microsoft.com/en-us/xamarin/android/platform/binding-java-library/troubleshooting-bindings#problem-noclassdeffounderror-in-packaging
I did this, but no luck. I have extracted the aar file to get the jar and added the classes.jar to the application's root directory, and set the build action to AndroidJavaLibrary.
Am I missing something?
Please post the details about the stacktrace.
Hi Jarvan, here is the stacktrace.
Sorry, cannot get the cause from the log info. Here is a similar issue, hope it'll be helpful.
https://stackoverflow.com/questions/28112728/classnotfoundexception-when-inflating-a-binding-library-using-xamarin