Configuring the CI/CD
Hello! I'm trying to create the CI/CD for this project right now in my fork with following builds:
- iOS/.ipa -- builds, but without
.ipaartifact. Looking for a way to solve this atm - macos/.dmg -- builds and deploys without issues
- windows/.exe -- builds and deploys without issues
- android/.apk -- unbuildable
- test -- fails
Here's my ci.yml file if you're interested in details, and here are all the logs.
While I'm not sure if .ipa could be built without personal macos pc, it builds and I think it's kind of enough for a bare minimum right now. I'm looking for a way to publish the .ipa still, but not very optimistic about it.
Tests are being run with flutter test command, and some of them are failing. I'm running it on macos-latest runner, but probably it's designed to run with something else or another command?
But the main question is .apk building. For a reference, I tried to build it on both windows-latest and ubuntu-latest runners with java version 16.0.2 (Am I guessing right, that we can't use latest or at least latest-lts java version because of gradle compatibility, which is currently 7.0.4 in the project?) with the following commands (took parts of code from your scripts):
rm lib/config/config.dart
mv lib/config/config.dart.sample lib/config/config.dart
cd scripts/ && source para.sh && cd ../
flutter build apk
CI fails on build with the following error:
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
* Where:
Build file '/home/runner/work/FEhViewer/FEhViewer/android/app/build.gradle' line: 63
* What went wrong:
A problem occurred evaluating project ':app'.
> path may not be null or empty string. path='null'
* 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 2m 22s
Running Gradle task 'assembleRelease'... 143.6s
Gradle task assembleRelease failed with exit code 1
Error: Process completed with exit code 1.
Do you have any idea on why is this happening? I'm sorry, that I'm not experienced in building with flutter and for android and can be missing something obvious...
Upd on build for iOS.
Ah, sorry, I've overlooked the build results. Even though it says Codesigning disabled with --no-codesign, skipping IPA, I still somehow get the .ipa in the end (thanks to reid and zip scripts I guess? Though I couldn't run dsym properly, is it crucial?).
Upd 2. Building for android on windows (not CI) fails due the same error as in OP.
Upd 3. Managed to build .apk, with commenting package signing in gradle props. I guess there's two ways to work around this:
- Comment package signing completely (do we really need this, since app is not distributed through google store?)
- Implement new configuration for CI/CD