BikeApp_demoss/android/app/build.gradle
2024-11-25 15:01:49 +08:00

127 lines
3.3 KiB
Groovy
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
react {
// ... 保持现有的 react 配置不变 ...
}
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "com.bikeapp_demo"
configurations {
all*.exclude group: 'com.amap.api', module: 'location'
}
buildFeatures {
buildConfig true
}
defaultConfig {
missingDimensionStrategy 'react-native-camera', 'general'
applicationId "com.bikeapp_demo"
minSdkVersion 24
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
// 移除这个部分因为我们在splits中已经定义了ABI
// ndk {
// abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
// }
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -fexceptions -frtti"
arguments "-DANDROID_STL=c++_shared"
}
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.22.1"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
ndk {
debugSymbolLevel 'FULL'
}
}
release {
signingConfig signingConfigs.debug
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
splits {
abi {
enable true
reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
universalApk false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/*/libIOTCAPIs.so'
pickFirst 'lib/*/libP2PTunnelAPIs.so'
pickFirst 'lib/*/libTUTKGlobalAPIs.so'
pickFirst 'lib/*/libtutk-bridge.so'
}
}
dependencies {
implementation("com.facebook.react:react-android")
implementation project(':react-native-camera')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':react-native-vlc-media-player')
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)