BikeApp_demoss/android/app/build.gradle

127 lines
3.3 KiB
Groovy
Raw Permalink Normal View History

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
react {
2024-11-25 15:01:49 +08:00
// ... 保持现有的 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"
2024-11-14 13:56:11 +08:00
configurations {
all*.exclude group: 'com.amap.api', module: 'location'
}
2024-11-25 15:01:49 +08:00
buildFeatures {
buildConfig true
}
defaultConfig {
2024-11-25 15:01:49 +08:00
missingDimensionStrategy 'react-native-camera', 'general'
applicationId "com.bikeapp_demo"
2024-11-25 15:01:49 +08:00
minSdkVersion 24
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
2024-11-25 15:01:49 +08:00
// 移除这个部分因为我们在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"
}
}
2024-11-25 15:01:49 +08:00
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
2024-11-25 15:01:49 +08:00
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
2024-11-25 15:01:49 +08:00
ndk {
debugSymbolLevel 'FULL'
}
}
release {
signingConfig signingConfigs.debug
2024-11-25 15:01:49 +08:00
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
2024-11-25 15:01:49 +08:00
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")
2024-11-12 09:34:25 +08:00
implementation project(':react-native-camera')
2024-11-25 15:01:49 +08:00
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
}
}
2024-11-25 15:01:49 +08:00
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)