大概會報這幾個錯
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或以上然后就可以編譯通過了