Я использую компонент из этого пакета для загрузки моего экспортированного проекта Unity
Если я загружаю простой проект Unity, например https://github.com/IVainqueur/flop-unity, а затем выполните экспорт Android, после чего я смогу поместить сборку в свой каталог unity/builds/android/unityLibrary. Затем я выполняю сборку приложения и успешно вижу проект Unity
Однако, если я хочу использовать более продвинутый проект Unity, например образцы AR Foundation с https://github. com/Unity-Technologies/arfoundation-samples, тогда у меня проблема. Я могу экспортировать Android из Unity, поместить файлы в каталог unity/builds/android/unityLibrary, а затем выполнить сборку моего приложения React Native для Android.
The React Сборка собственного приложения завершается неудачно с ошибками, указанными ниже. Кажется, отсутствует шаг, позволяющий приложению React Native читать каталог libs.
Код: Выделить всё
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':unityLibrary:compileDebugAidl'.
Could not resolve all task dependencies for configuration ':unityLibrary:debugCompileClasspath'.
Could not find :arcore_client:.
Required by:
project :unityLibrary
Could not find :UnityARCore:.
Required by:
project :unityLibrary
Could not find :ARPresto:.
Required by:
project :unityLibrary
Could not find :unityandroidpermissions:.
Required by:
project :unityLibrary
Код: Выделить всё
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 22
compileSdkVersion = 33
targetSdkVersion = 33
// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
}
repositories {
google()
mavenCentral()
flatDir {
dirs "${project(':unityLibrary').projectDir}/libs"
}
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
}
}
Код: Выделить всё
rootProject.name = 'projectName'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
include ':unityLibrary'
project(':unityLibrary').projectDir=new File('../unity/builds/android/unityLibrary')
include ':unityLibrary:xrmanifest.androidlib'
Подробнее здесь: https://stackoverflow.com/questions/775 ... -unity-pro
Мобильная версия