flutter 项目 check下来 一些配置修改

问题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 改成本地的签名文件路径

参考链接

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值