Forum Xamarin.Android

Bindings for Android Native Library (aar) with Realm as a transitive dependency

Hello all! I'm new to Xamarin but have some experience in Native Android Development. I have an android library (aar) I want to create C# bindings for. This library has a lot of transient dependencies:

implementation "com.android.support:support-annotations:${supportLibraryVersion}"
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
implementation "com.android.support:exifinterface:${supportLibraryVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibraryVersion}"
implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
implementation "com.android.support.constraint:constraint-layout:${constraintLayoutVersion}"
implementation "com.android.support:design:${supportLibraryVersion}"
implementation "pub.devrel:easypermissions:${easyPermissionsVersion}"
implementation "com.scottyab:secure-preferences-lib:${secureSharedPreferencesVersion}"
implementation "com.squareup.retrofit2:retrofit:${retrofit2Version}"
implementation "com.squareup.okhttp3:logging-interceptor:${okhttp3LoggingInterceptorVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofit2Version}"
implementation "com.google.code.gson:gson:${gsonAnnotationVersion}"
implementation "io.socket:socket.io-client:${socketIoVersion}"
implementation "net.danlew:android.joda:${yodaTimeVersion}"
implementation "com.google.android.gms:play-services-maps:${playServicesVersion}"
implementation "com.github.bumptech.glide:glide:${glideVersion}"
annotationProcessor "com.github.bumptech.glide:compiler:${glideVersion}"
implementation "com.github.bumptech.glide:okhttp3-integration:${glideVersion}"
implementation("com.github.bumptech.glide:recyclerview-integration:${glideVersion}", {
    transitive = false
})
annotationProcessor "com.google.dagger:dagger-compiler:${daggerVersion}"
implementation "com.google.dagger:dagger:${daggerVersion}"
compileOnly "javax.inject:javax.inject:${javaxInjectVersion}"
implementation "io.reactivex.rxjava2:rxjava:${rxJavaVersion}"
implementation "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}"
annotationProcessor "javax.annotation:jsr250-api:${javaxAnnotationVersion}"

And also it has Android-Realm (Java) dependency that is added into build.gradle file (in native android project) as a plugin. Example below:

(Project build.gradle file) :smile:
buildscript {

repositories {
    jcenter()
}
dependencies {
    classpath "io.realm:realm-gradle-plugin:3.1.4"
}

}
(App build.gradle file: )
apply plugin: 'realm-android'

As I understood I need to create bindings for my AAR lib and also add all its dependencies as references to xamarin project by using NuGet. Right?
If NuGet doesn't have some of dependency I need to get this dependency as a AAR and create additional C# bindings with it.

But what about Realm? I can't find its aar file on the internet and also NuGet doesn't have it. Could anyone explain me how to do complete C# bindings for such kind of library please?

Answers

  • AditkothariAditkothari USMember ✭✭
    edited April 3
    Any update on this?
    I am also facing the same issue. Is Realm having aar file which can be binded to Xamarin?
Sign In or Register to comment.