Skip to content

Execution failed for task ':app:generateJsonModelDebug'. > executing external native build for cmake #2222

@2439905184

Description

@2439905184

Task :app:generateJsonModelDebug FAILED
prefabNo compatible library found for //oboe/oboe. Rejected the following libraries:
prefabandroid.arm64-v8a: User is targeting armeabi-v7a but library is for arm64-v8a
prefabandroid.armeabi-v7a: User is using a static STL but library requires a shared STL
prefabandroid.x86: User is targeting armeabi-v7a but library is for x86
prefabandroid.x86_64: User is targeting armeabi-v7a but library is for x86_64
prefabNo compatible library found for //oboe/oboe. Rejected the following libraries:
prefabandroid.arm64-v8a: User is using a static STL but library requires a shared STL
prefabandroid.armeabi-v7a: User is targeting arm64-v8a but library is for armeabi-v7a
prefabandroid.x86: User is targeting arm64-v8a but library is for x86
prefabandroid.x86_64: User is targeting arm64-v8a but library is for x86_64

build.gradle:plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.xsh.opensltest"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        ndk { stl "c++_shared"
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
     //   testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildFeatures {
        prefab true
    }
    buildTypes {
        release {
            minifyEnabled false
         //   proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    ndkVersion "21.1.6352462"
    externalNativeBuild {
        /*ndkBuild {
            // 指定 Android.mk 文件路径
            path file("src/main/jni/Android.mk")
        }*/
        cmake{
           path "src/main/jni/CMakeLists.txt"
        }

    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.material:material:1.1.0'
//    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  //  testImplementation 'junit:junit:4.+'
   // androidTestImplementation 'androidx.test.ext:junit:1.1.1'
   // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation project(":spiderman-debug")
    implementation project(":simple-xml-2.7.1")
//    implementation project(":pianoview-debug")
  //  implementation("com.google.oboe:oboe:1.9.3")
    implementation 'com.google.oboe:oboe:1.6.1' // 使用最新版本

}

agp version : 4.1.3
CMakeLists.txt

cmake_minimum_required(VERSION 3.4.1)

project(hello C)
# Build our own native library
#add_library (native-lib SHARED stringFromSo.c)
add_library (native-lib SHARED OboeEngine.cpp)
# Find the Oboe package
find_package (oboe REQUIRED CONFIG)

# Specify the libraries which our native library is dependent on, including Oboe
target_link_libraries(native-lib log oboe::oboe)

#target_link_libraries(native-lib log)

openjdk 8,windows7 ,gradle:6.5 , use prefab lib

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions