问题1:
/MainActivity.kt: (19, 48): Type mismatch: inferred type is MainActivity but FlutterEngine was expected
% flutter build apk --no-shrink
Running "flutter pub get" in qianduoduo... 0.9s
You are building a fat APK that includes binaries for android-arm, android-arm64,
android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split
the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64
--split-per-abi
Learn more on:
https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
注: /Users/maochengfang/development/flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%47dart-pub/core_location_fluttify-0.2.4/android/src/main/java/me/yohom/core_location_fluttify/CoreLocationFluttifyPlugin.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
注: /Users/maochengfang/development/flutter/.pub-cache/hosted/mirrors.tuna.tsinghua.edu.cn%47dart-pub/flutter_native_image-0.0.5+3/android/src/main/java/com/example/flutternativeimage/FlutterNativeImagePlugin.java使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
e: /Users/maochengfang/jingliOrigin/qianduoduo/android/app/src/main/kotlin/com/congrong/qianduoduo/MainActivity.kt: (19, 48): Type mismatch: inferred type is MainActivity but FlutterEngine was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 15s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 75.9s
Gradle task assembleRelease failed with exit code 1
解决:
<!-- <meta-data
android:name="flutterEmbedding"
android:value="2" /> -->
问题2:
not found for signing config 'release'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file '/Users/kouhao/Documents/keys/key.jks' not found for signing config 'release'
解决:
store file 改成本地的签名文件路径