【发布时间】:2019-04-21 14:54:29
【问题描述】:
我尝试从 Unity 导出项目,然后将其作为库从 Android Studio 导出,但是当我将该库导入另一个项目时,我收到错误:E/Unity: Unable to find arpresto_api
(如果我在不导出为库的情况下运行它,一切正常)
我们将不胜感激。
已经试过Unity + ARCORE DllNotFoundException: arcore_unity_api 它不起作用。
分级:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'arcore_client', ext:'aar')
implementation(name: 'arcore_unity', ext:'aar')
implementation(name: 'google_ar_required', ext:'aar')
implementation(name: 'unityandroidpermissions', ext:'aar')
implementation(name: 'unitygar', ext:'aar')
}
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion 26
targetSdkVersion 28
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
versionCode 1
versionName '0.1'
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb']
}
buildTypes {
debug {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
jniDebuggable true
}
release {
minifyEnabled false
useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
signingConfig signingConfigs.debug
}
}
packagingOptions {
doNotStrip '*/armeabi-v7a/*.so'
doNotStrip '*/x86/*.so'
}
splits {
language {
enable false
}
density {
enable false
}
abi {
enable true
}
}
}
E/Unity: Unable to find arpresto_api
E/Unity: DllNotFoundException: arcore_unity_api
at (wrapper managed-to-native) GoogleARCoreInternal.ARPrestoCallbackManager+ExternApi.ArCoreUnity_setArPrestoInitialized(GoogleARCoreInternal.ARPrestoCallbackManager/EarlyUpdateCallback)
at GoogleARCoreInternal.ARPrestoCallbackManager._Initialize () [0x0002c] in /Users/petrosmaliotis/New Unity Project 4/Assets/GoogleARCore/SDK/Scripts/Managers/ARPrestoCallbackManager.cs:181
at GoogleARCoreInternal.ARPrestoCallbackManager.get_Instance () [0x00018] in /Users/petrosmaliotis/New Unity Project 4/Assets/GoogleARCore/SDK/Scripts/Managers/ARPrestoCallbackManager.cs:91
at GoogleARCoreInternal.ARCoreAndroidLifecycleManager.get_Instance () [0x00023] in /Users/petrosmaliotis/New Unity Project 4/Assets/GoogleARCore/SDK/Scripts/Managers/ARCoreAndroidLifecycleManager.cs:80
at GoogleARCoreInternal.LifecycleManager.get_Instance () [0x00029] in /Users/petrosmaliotis/New Unity Project 4/Assets/GoogleARCore/SDK/Scripts/Managers/LifecycleManager.cs:43
at GoogleARCore.ARCoreS
【问题讨论】: