Browse Source

修复 Android release 构建失败:依赖版本漂移与 .gitignore 校准

- NDK: 升到 28.2.13676358,满足 jni 插件要求
- fleather: 锁定到 1.26.0,避开 1.27.0 误用 updateStyle/TextInputStyle 的回归
- MainActivity: 重复注册检测改用 FlutterFirebaseCorePlugin,path_provider_android 2.3.0+ 已移除 Java 端 PathProviderPlugin
- .gitignore: 提交根目录 pubspec.lock 避免依赖被自动升级;继续忽略 local_plugins/**/pubspec.lock(plugin 包不应锁定)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
newdev_shunjiawei
lxm 5 months ago
parent
commit
bff920957d
  1. 7
      .gitignore
  2. 2
      android/app/build.gradle.kts
  3. 2
      android/app/src/main/kotlin/com/saitong/voitrans/MainActivity.kt
  4. 2117
      pubspec.lock
  5. 2
      pubspec.yaml

7
.gitignore

@ -7,9 +7,6 @@
.dart_tool/ .dart_tool/
.packages .packages
build/ build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc # Directory created by dartdoc
# If you don't generate documentation locally you can remove this line. # If you don't generate documentation locally you can remove this line.
doc/api/ doc/api/
@ -33,7 +30,9 @@ CLAUDE.md
.dart_tool/ .dart_tool/
.packages .packages
build/ build/
pubspec.lock
# local_plugins 是 Flutter plugin packages(library),不应提交 lock 文件
local_plugins/**/pubspec.lock
# IDE specific # IDE specific
.idea/ .idea/

2
android/app/build.gradle.kts

@ -25,7 +25,7 @@ val keystoreProperties =Properties().apply {
android { android {
namespace = "com.saitong.voitrans" namespace = "com.saitong.voitrans"
compileSdk = 36 compileSdk = 36
ndkVersion = "28.0.13004108" ndkVersion = "28.2.13676358"
compileOptions { compileOptions {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11

2
android/app/src/main/kotlin/com/saitong/voitrans/MainActivity.kt

@ -145,7 +145,7 @@ class MainActivity: FlutterActivity() {
val pluginRegistry = flutterEngine.plugins val pluginRegistry = flutterEngine.plugins
// 只有在插件未注册时才调用 GeneratedPluginRegistrant // 只有在插件未注册时才调用 GeneratedPluginRegistrant
if (!pluginRegistry.has(io.flutter.plugins.pathprovider.PathProviderPlugin::class.java)) { if (!pluginRegistry.has(io.flutter.plugins.firebase.core.FlutterFirebaseCorePlugin::class.java)) {
Log.d(TAG, "📦 注册 Flutter 插件") Log.d(TAG, "📦 注册 Flutter 插件")
super.configureFlutterEngine(flutterEngine) super.configureFlutterEngine(flutterEngine)
GeneratedPluginRegistrant.registerWith(flutterEngine) GeneratedPluginRegistrant.registerWith(flutterEngine)

2117
pubspec.lock

File diff suppressed because it is too large

2
pubspec.yaml

@ -30,7 +30,7 @@ dependencies:
audio_session: ^0.1.18 audio_session: ^0.1.18
flutter_markdown: ^0.7.7+1 flutter_markdown: ^0.7.7+1
markdown: ^7.1.1 markdown: ^7.1.1
fleather: ^1.26.0 fleather: 1.26.0
parchment: ^1.25.1 parchment: ^1.25.1
htmltopdfwidgets: ^1.1.0 htmltopdfwidgets: ^1.1.0
wifi_iot: ^0.3.19+2 wifi_iot: ^0.3.19+2

Loading…
Cancel
Save