I am trying to use azure spatial anchors with the unity android app. However, I am always getting the error mentioned below when try to run on unity.
DllNotFoundException: azurespatialanchorsndk
Microsoft.Azure.SpatialAnchors.CloudSpatialAnchorSession..ctor () (at Library/PackageCache/[email protected]/Runtime/AzureSpatialAnchorsBridge_Android.cs:2056) AzureSpatialAnchor.CreateAzureSession () (at Assets/Scripts/AzureSpatialAnchor.cs:82)
AzureSpatialAnchor.Awake () (at Assets/Scripts/AzureSpatialAnchor.cs:58)
Also, when I try to deploy the app on android, the app always crashes with azure spatial ancors functionality. Below are the logs from android logcat
2021/01/21 19:51:59.359 13344 18592 Info multiplayerdem Thread[17,tid=18592,Native,Thread*=0xcf456800,peer=0x12d406f8,"UnityMain"] recursive attempt to load library "/data/app/com.DefaultCompany.armultiplayerdemo-p-urYsoMMitWiE2Z6JXUqg==/base.apk!/lib/armeabi-v7a/libazurespatialanchorsndk.so"
2021/01/21 19:51:59.404 13344 18592 Error CRASH #01 Microsoft.Azure.SpatialAnchors.CloudSpatialAnchorSession:Start () <C:Users
ash8327Desktopar-multiplayer-demoLibraryPackageCachecom.microsoft.azure.spatial-anchors-sdk.android@2.7.0RuntimeAzureSpatialAnchorsBridge_Android.cs:2593>
Below is my mainTemplate.gradle file that I have used for the build
buildscript {
repositories {
google()
jcenter()
}
dependencies {
// Must be Android Gradle Plugin 3.6.0 or later. For a list of
// compatible Gradle versions refer to:
// https://developer.android.com/studio/releases/gradle-plugin
classpath 'com.android.tools.build:gradle:3.6.0'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.library'
**APPLY_PLUGINS**
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation('com.squareup.okhttp3:okhttp:[3.11.0]')
implementation('com.microsoft.appcenter:appcenter-analytics:[1.10.0]')
**DEPS**
// Azure Spatial Anchors
//implementation ("com.microsoft.azure.spatialanchors:spatialanchors_ndk:[2.7.0]") {
// exclude group: 'com.google.ar'
//}
//natives "com.microsoft.azure.spatialanchors:spatialanchors_ndk:[2.7.0]"
}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
}
versionCode **VERSIONCODE**
versionName '**VERSIONNAME**'
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
}
lintOptions {
abortOnError false
}
aaptOptions {
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}**PACKAGING_OPTIONS**
}**REPOSITORIES****SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
I have tried everything but this error does not resolve.
------- Versions--------
- Unity : 2019.4.15f1
- AR Foundation : 4.1.1 3. AR Subsystems : 4.1.1
- ARCore XR Plugin: 4.1.1
- Azure Spatial Anchor : 2.7.0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…