Flutter依赖(引入)蒲公英SDK导致报错

大概会报这几个错

Finished with error: Gradle task assembleDebug failed with exit code 1
G:\FlutterSDK\fluttersdk\.pub-cache\hosted\pub.flutter-io.cn\flutter_pgyer-1.0.1\android\src\main\java\com\crazecoder\flutter.pgyer\FlutterPgyerPlugin.java:214: ����: �Ҳ�������
                        public void downloadSuccessful(File file) {
                                                       ^
  ����: �� File
1 ������

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_pgyer:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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 11s
Finished with error: Gradle task assembleDebug failed with exit code 1

 

如果在flutter 项目中引入蒲公英SDK报错

那么  大概 用pub的方式引入也就是这样

pub

flutter_pgyer: ^1.0.1

如果用上面这种方法引入蒲公英SDK,那么你的问题就可以在这里得到解决,如果不是,你就可以退出了

解决方法:使用GitHub的方式引入

  flutter_pgyer:
    git:
      url: https://github.com/crazecoder/flutter_pgyer.git

 

 运行成功,然后就可以写你的更新的逻辑代码了,这里就暂时没有这个代码,因为我也是第一次用,还没写到,等我写好了再更新

 

 

这时候虽然可以运行,但是打包失败这时候我们需要改源码

 

 

 找到蒲公英的包 flutter_pgyer打开build.gradle,

compileSdkVersion 28这里的版本默认是22,我这里已经改过了,我们要改为28或以上然后就可以编译通过了

 

posted @ 2020-02-13 16:30  在云端i  阅读(1340)  评论(0编辑  收藏  举报