diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 0b53e4a8f..f3c13c5fc 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -61,7 +61,8 @@ android { manifestPlaceholders.putAll( mapOf( "redirectSchemeName" to "spotify-sdk", - "redirectHostName" to "auth" + "redirectHostName" to "auth", + "applicationName" to "com.saitong.voitrans.MyApp" // 新增:声明自定义 Application ) ) // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). @@ -105,7 +106,11 @@ android { "proguard-rules.pro" ) signingConfig = signingConfigs.getByName("release") - // signingConfig = signingConfigs.getByName("debug") + + // Release 版本只保留 arm64-v8a 和 armeabi-v7a(移除 x86/x86_64) + ndk { + abiFilters += listOf("armeabi-v7a", "arm64-v8a") + } } debug { isMinifyEnabled = false @@ -115,6 +120,11 @@ android { "proguard-rules.pro" ) signingConfig = signingConfigs.getByName("debug") + + // Debug 版本保留所有 ABI(包括 x86/x86_64,用于模拟器) + ndk { + abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64") + } } } } @@ -122,6 +132,9 @@ android { dependencies { // 添加核心库反糖化 coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") + + // 添加 CardView 依赖 + implementation("androidx.cardview:cardview:1.0.0") } flutter { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e1ca0f551..915595a3f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,6 +2,7 @@ xmlns:tools="http://schemas.android.com/tools"> + @@ -84,8 +85,7 @@ + +