I create my own android project to display a 360 picture with the recent version of google cardboard sdk(is a set of librairies) and when i am trying to create an aar from this project to use it as module in an other project I see that the classes in the google cardboard sdk didn't exist in my aar and i only have classes and dependencies of the app module .
this is the generated aar from my app project : app_aar_generated
and also the generated aar from the google cardboard sdk with generated folders that i needed in my final aar: sdk_aar_generated
I tried to integrate this sdk with differents methos (convert it to aar , use it as module...) i also saw that i can add transitive to add transitive dependencies but this variable is deprecated in the newer version of gradle because the transitive dependencies become by default. but the problem persist and the aar is generated without the needed classes of the sdk cardboard library any suggestions please, who had the same issue ?
this is my app build.gradle:
android {
compileSdkVersion 31
lintOptions {
abortOnError false
}
defaultConfig {
// applicationId "com.google.cardboard.hellocardboard"
// #gles3 #vulkan - You can reduce minSdkVersion down to 16 depending
// on rendering APIs supported:
//
// OpenGL ES 2.0 - Requires 16 or higher
// OpenGL ES 3.0 - Requires 18 or higher
// Vulkan - Requires 24 or higher
//
// See the release notes for details.
minSdkVersion 24
targetSdkVersion 31
versionCode 1
versionName "1.20.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
multiDexEnabled true // Enabling multidex support (should fix first time crash) : // It appears it is required when setting minSdkVersion to 20 or lower, so maybe we can remove it ? // TODO
externalNativeBuild.cmake {
arguments "-DANDROID_STL=c++\_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild.cmake {
path "CMakeLists.txt"
}
namespace 'com.google.cardboard'
}
dependencies {
implementation fileTree(dir: 'libs', include: \['\*.jar'\])
implementation 'androidx.appcompat:appcompat:1.4.2'
// Android Mobile Vision
// TODO(b/213613345) Migrate to ML Kit.
implementation 'com.google.android.gms:play-services-vision:20.1.3'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.protobuf:protobuf-javalite:3.19.4'
api project(":sdk")
//implementation project(":sdk")
implementation 'org.jetbrains:annotations:15.0'
}
// 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/\*\*/libGfxPluginCardboard.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)```