我正在尝试使用 github 操作构建颤振 apk。在构建 apk 时出现错误。我无法在设备上构建,因为我只有智能手机(android)。那么我可以使用 github 操作构建还是需要 pc?
颤振医生的输出
JAVA_HOME_12.0.2_x64: /opt/hostedtoolcache/jdk/12.0.2/x64
JAVA_HOME: /opt/hostedtoolcache/jdk/12.0.2/x64
JAVA_HOME_12_0_2_X64: /opt/hostedtoolcache/jdk/12.0.2/x64
ANDROID_HOME: /usr/local/lib/android/sdk
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
FLUTTER_ROOT: /opt/hostedtoolcache/flutter/2.7.0-3.1.pre-beta/x64
PUB_CACHE: /opt/hostedtoolcache/flutter/2.7.0-3.1.pre-beta/x64/.pub-cache
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 2.7.0-3.1.pre, on Ubuntu 20.04.3 LTS 5.11.0-1020-azure, locale C.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] Connected device (1 available)
! Doctor found issues in 1 category.
gradle的输出
[ +193 ms] Starting a Gradle Daemon (subsequent builds will be faster)
[+40910 ms] FAILURE: Build failed with an exception.
[ +7 ms] * Where:
[ ] Build file '/home/runner/work/app/app/android/app/build.gradle' line: 32
[ ] * What went wrong:
[ ] A problem occurred evaluating project ':app'.
[ ] > Could not get unknown property 'compileSdkVersion' for extension 'flutter' of type FlutterExtension.
[ ] * 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 47s
[ +668 ms] Running Gradle task 'assembleRelease'... (completed in 48.1s)
[ +4 ms] "flutter apk" took 48,474ms.
[ +3 ms] Gradle task assembleRelease failed with exit code 1
[ +6 ms] ensureAnalyticsSent: 3ms
[ +1 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ +1 ms] exiting with code 1
Error: Process completed with exit code 1.