Issues integrating the Azure Spatial Anchors API RRS feed

  • Question

  • Hi all,

    I've playing with the Azure Spatial Anchors API. My ultimate goal is to use that API in a Xamarin application. But I ended up with a weird problem. The native Microsoft library makes calls to functions in a class names NativeLibrary (com.microsoft.azure.spatialanchors) but, at runtime, the system can't find the implementations for those functions. The app crashes with errors similar to

    java.lang.UnsatisfiedLinkError: No implementation found for com.microsoft.azure.spatialanchors.status com.microsoft.azure.spatialanchors.NativeLibrary.ssc_cloud_spatial_anchor_session_create

    Initially I thought that I was doing something wrong with linking the right AARs and getting the proper dependencies, but when I tried to start a project from scratch in Android Studio I ended up having the same issue. In the java project, when trying to create a new CloudSpatialAnchorSession object, the constructor for that object crashes in the second line:

    public CloudSpatialAnchorSession() {
        Out<Long> result_handle = new Out();
        status resultStatus = NativeLibrary.ssc_cloud_spatial_anchor_session_create(result_handle);
        this.handle = (Long)result_handle.value;
        NativeLibraryHelpers.checkStatus(this.handle, resultStatus);

    For the record, I pulled most of my information from the Azure samples (can't link right now but it's azure-spatial-anchors-samples),  the sample project works fine in my computer and phone and I copied all settings that I could from the test project into the custom project that I made. I'll post my module gradle just in case:

    apply plugin: 'com.android.application'
    def azureSpatialAnchorsSdkVersion = '1.1.0'
    android {
        compileSdkVersion 27
        defaultConfig {
            applicationId "com.azurelib.azureanchorsclean"
            minSdkVersion 24
            targetSdkVersion 27
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation 'com.android.support:appcompat-v7:27.1.1'
        implementation 'com.android.support.constraint:constraint-layout:1.1.3'
        implementation 'com.google.ar:core:1.7.0'
        implementation "com.microsoft.azure.spatialanchors:spatialanchors_jni:[${azureSpatialAnchorsSdkVersion}]"
        implementation "com.microsoft.azure.spatialanchors:spatialanchors_java:[${azureSpatialAnchorsSdkVersion}]"
        implementation 'de.javagl:obj:0.2.1'
        implementation 'com.microsoft.aad:adal:1.16.0'
        testImplementation 'junit:junit:4.12'
        androidTestImplementation 'com.android.support.test:runner:1.0.2'
        androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    Tuesday, May 28, 2019 7:23 AM

All replies

  • Hi,

    Since the problem is more related to Xamarin app and Azure APIs, it is out of the scope of UWP apps. I'd suggest that you might need to ask about this in Xamarin's official forum or Azure AD forum.

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 29, 2019 1:47 AM
  • Hi,

    Thank you!

    When you say "Azure AD", do you mean Azure Active directory? Why there?

    Wednesday, May 29, 2019 3:26 AM