Я пытаюсь скомпилировать образец Google Cardboard Sdk.
Я следую инструкциям Официальных документов Google
Я застрял на шаге 3, где я нахожусь предполагается собрать проект:
Это ошибка, которую я получаю, когда начинаю сборку:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':hellocardboard-android:externalNativeBuildDebug'.
> Build command failed.
Error while executing process C:\Users\Shanu\AppData\Local\Android\Sdk\cmake\3.10.2.4988404\bin\ninja.exe with arguments {-C C:\Projects\cardboard\hellocardboard-android\.cxx\cmake\debug\x86 cardboard_jni}
ninja: Entering directory `C:\Projects\cardboard\hellocardboard-android\.cxx\cmake\debug\x86'
ninja: error: '../../../../libraries/jni/x86/libcardboard_api.so', needed by '../../../../build/intermediates/cmake/debug/obj/x86/libcardboard_jni.so', missing and no known rule to make it
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
29 actionable tasks: 2 executed, 27 up-to-date
1:55:12 PM: Task execution finished 'assemble'.
Тогда Я пытался запустить с --stacktrace
Caused by: org.gradle.internal.UncheckedException: Build command failed.
Но есть дополнительное предупреждение:
WARNING: This app only has 32-bit [armeabi-v7a,x86] native libraries. Beginning August 1, 2019 Google Play store requires that all apps that include native libraries must provide 64-bit versions. For more information, visit https://g.co/64-bit-requirement
Ну, это не дает мне идеи, так как я никогда не использовал NDK / Cardboard SDK.
Вот как выглядит build.gradle(hellocardboard)
:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.google.cardboard.hellocardboard"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
externalNativeBuild {
cmake {
cppFlags "-std=gnu++11"
arguments "-DANDROID_STL=c++_shared"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// Android Mobile Vision
implementation 'com.google.android.gms:play-services-vision:15.0.2'
//noinspection GradleCompatible
implementation 'com.android.support:design:28.0.0'
implementation project(":sdk")
}
// The dependencies for NDK builds live inside the .aar files so they need to
// be extracted before NDK targets can link against.
task extractNdk(type: Copy) {
if (file("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar").exists()) {
copy {
from zipTree("${project.rootDir}/sdk/build/outputs/aar/sdk-release.aar")
into "libraries/"
include "jni/**/libcardboard_api.so"
}
copy {
from "${project.rootDir}/sdk/include/cardboard.h"
into "libraries/"
}
}
}
task deleteNdk(type: Delete) {
delete "libraries/jni"
delete "libraries/cardboard.h"
}
build.dependsOn(extractNdk)
clean.dependsOn(deleteNdk)
Вот весь проект, размещенный на моем GitHub
Все в настройках Google по умолчанию, и я ничего не настроил, кроме установки этих компонентов из менеджера SDK:
- CMake
- LLDB
- NDK (Бок о бок)
В чем здесь проблема и как ее исправить?