- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试构建一个 Unity ARCore 应用程序,它将嵌入到现有的父 android 应用程序中。 ARCore 项目作为一个独立的项目运行良好(既是来自 Unity 的直接 apk,也是从导出的 unity android studio 项目创建的 apk)。
当我从导出的 unity android studio 项目创建一个“.aar”库文件并将其集成到主 android 应用程序时,它没有运行,并且出现以下错误:缺少 Unity Engine ARCore 支持。请确保 Unity 项目启用了“Player Settings > XR Settings > ARCore Supported”复选框。。
我已确保在 XR 设置中启用了“支持 ARcore”(独立应用运行良好这一事实也证实了这一点)。此外,统一启动从父应用程序正确发生(我可以看到我的统一用户界面和启动动画等),只有 ARCore 相机没有初始化并出现上述错误。
以下是我创建“.aar”所遵循的教程链接: https://medium.com/@davidbeloosesky/embedded-unity-within-android-app-7061f4f473a
以下是Unity android studio导出工程的build.gradle文件
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation(name: 'arcore_client', ext:'aar')
implementation(name: 'arcore_rendering_utils', 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 28
buildToolsVersion '29.0.2'
defaultConfig {
minSdkVersion 24
targetSdkVersion 28
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86'
}
versionCode 1
versionName '1.0'
}
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 '*/arm64-v8a/*.so'
doNotStrip '*/x86/*.so'
}
}
下面是android list
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.mbrd.ar" xmlns:tools="http://schemas.android.com/tools" android:installLocation="auto">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name" android:isGame="false" android:banner="@drawable/app_banner">
<activity android:label="@string/app_name" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false" android:name="com.mbrd.ar.UnityPlayerActivity">
<!--<intent-filter>-->
<!--<action android:name="android.intent.action.MAIN" />-->
<!--<category android:name="android.intent.category.LAUNCHER" />-->
<!--</intent-filter>-->
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
</activity>
<meta-data android:name="unity.tango-enable" android:value="True" />
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="true" />
<meta-data android:name="unity.build-id" android:value="5147ef97-4e9e-47dd-b7ec-317134f40251" />
<meta-data android:name="unity.splash-mode" android:value="0" />
<meta-data android:name="unity.splash-enable" android:value="True" />
<meta-data android:name="android.max_aspect" android:value="2.1" />
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>
我使用的是 unity 2018.2.16。
任何人都可以给出可能的原因以及可以采取什么措施来解决这个问题的想法吗?
谢谢
最佳答案
遇到这个问题的人:
能够解决这个问题。这是一个项目设置问题。将脚本运行时版本设置为 .NET 4.x 等效版本并将 Api 兼容级别设置为 .NET Standard 2.0 为我解决了这个问题。
关于android - 无法将 Unity ARCore 项目作为 android .AAR 库运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58637501/
我们向客户发送了一个 android sdk (aar) 文件。我们的代码在内部使用两个第 3 方 aar,我们在我们的 repo 和 gradle 在运行时引用它。我的问题是如何将这些依赖项发送给客
我正在努力构建可用于其他应用程序的 SDK。 我的项目结构如下: ProjectFolder | +--AndroidLibs | | | +--UI (andro
如果我有作为 SDK 的项目 A,并且它作为 AAR 导出到项目 B 中,项目 B 将模块作为 AAR 导入,我该如何链接这两个模块,所以对项目 B 中的 AAR 所做的更改不会必须在原始项目-A中复
我是一名插件开发人员,我的插件依赖于两个 aar 库。当我导出为 aar 存档时,我的依赖库不是它的一部分。我的项目结构如下所述 App lib1 --aartool lib2 lib3
我有一个以 aar 格式分发的 android 库。它重300kb。我想创建另一个库,也是 aar 格式,其中依赖项中的第一个库。但是结果库权重是30kb,显然不包括第一个库。 我尝试使用 flatD
如何访问 AAR 库中的 Activity,它不是直接包含在项目中而是嵌入到另一个 AAR 库中? 我得到一个错误 java.lang.NoClassDefFoundError: Failed res
你能帮我理解构建 android 库并在用户应用程序中使用它的一般概念吗。 那么,有以下情况: 在android studio中有以下模块: 核心 数据 绘图 还有一个模块 应用 依赖于上述模块。 a
关于 Gradle 中 AAR 文件的传递依赖关系存在一些问题: Android Studio 0.2.3 cannot resolve transitive aar dependencies And
我看到了各种开发人员发布的问题(Android Studio combine 2 .aar into one 和其他人),但我还没有看到明确的答复使我能够创建一个包含 1 个或多个 AAR 或 JAR
我正在使用Xamarin开发一个APP,需要使用Android Studio(AS)开发的其他aar。 在 AS 中,我创建了一个名为“javaLib”的 Java 库模块。构建后,我得到了javaL
无法发布配置“文件”,无法发布 Artifact danlu-bluetooth.aar (/Users/xxx/work/xxx/workplace/androidcode/libraray/xxx
我正在使用 Android Studio 1.5。我有一个图书馆项目,core-speech-service.aar。此 AAR 文件已正确生成(所有类都构建并打包在 AAR 文件中的 classes
我写了一些库,它有一部分 UI。此外,此库使用其他库。我想提供版本 .aar 以在任何应用程序中使用此 UI 部分。 我的图书馆有下一个依赖: compile 'com.android.sup
所以,事情是这样的,我有一个 .aar 文件,当我将它添加为依赖项时,如下所示: 编译('com.foo:bar:1.0.0@aar') 它生成以下文件: build > intermediates
我正在使用另一个 aar 和 jar 文件依赖项创建 AAR 文件。我已成功创建 .aar 发布文件。 然后,我将新的 AAR 文件导入到示例项目中。该项目运行良好。当访问 aar 和 jar 类时,
我正在创建一个具有“directions-api.aar”(Here-Maps 小部件库)的旧依赖项的 android 应用程序,现在我需要为 Map 的实现添加“HERE-sdk.aar”。 这导致
我通过将我的应用程序转换为库来为应用程序贴上白色标签,并且我有一个配置文件被传递到库以更改颜色、添加新的加载动画、更改一些文本等。库拥有所有这些上面列出的依赖项。当我将库导入新应用程序时,由于新应用程
我有一个顶级 android 库模块(包含 res 文件夹)依赖于其他库子模块(无 res)。我想构建一个顶层模块的 fat aar,它应该包括子模块的 jar 以及我在 build.gradle 中
我在 Intranet maven repo 中有一个 utility.aar。它使用了一些众所周知的 jar ,例如 gson。我已将它们定义为实用程序模块的 build.gradle 中的编译依赖
我正在按照 camera_deep_ar 上的插件页面中给出的文档进行操作 我已将 minimumSdkVersion 设置为 19 在 AndroidManifest.xml 中正确赋予权限 正确设
我是一名优秀的程序员,十分优秀!