Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Binding a library using a combination of InputJar and ReferenceJar?

I am trying to use Redth/Xamarin.Android.Xposed (on GitHub) in Xamarin but the final result is rejected by Xposed, saying: "cannot load module" .. "the xposed api classes are compiled into the module's apk". The xposed-api.jar file is currently a EmbeddedJar, which is what causes that error. The xposed-api.jar file is made available during run-time by Xposed already.

From the xamarin docs.

InputJar – Does not embed the .jar into the resulting Bindings Library .DLL. Your Bindings Library .DLL will have a dependency on this .jar at runtime.

InputJar seems like it will solve my issue with it being compiled into the resulting apk. However, it can't compile into an apk at all. It gives me errors in the generated java file such as.

JAVAC0000: error: package de.robv.android.xposed does not exist de.robv.android.xposed.IXposedHookLoadPackage 0

Then for ReferenceJar..

ReferenceJar – Specifies a reference .jar: a reference .jar is a .jar that one of your bound .jar or .AAR files depends on. This reference .jar is used only to satisfy compile-time dependencies. When you use this build action, C# bindings are not created for the reference .jar and it is not embedded in the resulting Bindings Library .DLL.

Great, it will provide it during compile-time.. however, no bindings will be generated so I can't use it.

I also tried combining these by creating 2 identical libraries with one having InputJar and the other ReferenceJar, but that did not work at all.

How can I achieve what I am trying to do?

To sum it up, I need to add xposed-api.jar as a library just like how android.jar of the Android framework is added. You can use the classes and compile properly, without the classes being compiled into the apk.

Tagged:
Sign In or Register to comment.