-
Notifications
You must be signed in to change notification settings - Fork 243
fix: created two build versions #1361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideIntroduces two API-specific Android product flavors in build.gradle to generate separate APKs for pre-Android 11 and post-Android 11 devices (as required for F-Droid), removes default SDK declarations to delegate to these flavors, and applies formatting improvements. Flow diagram for building APKs with new product flavorsflowchart TD
Start([Start]) --> ChooseFlavor{Select build flavor}
ChooseFlavor -- preApi30 --> BuildPre[Build APK with minSdk 21, targetSdk 29]
ChooseFlavor -- postApi30 --> BuildPost[Build APK with minSdk 30, targetSdk 34]
BuildPre --> OutputPre[Output: APK for Android 10 and below]
BuildPost --> OutputPost[Output: APK for Android 11 and above]
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that minSdkVersion and targetSdkVersion are defined only inside productFlavors, the build will fail unless a flavor is explicitly specified. Isn't it ?
so you mat define a default flavor using a Gradle property or make it clear in README.md how to specify the desired flavor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made a suugested change in the workfllow and updated the readme to use the correct commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone runs flutter build without a flavor, the build will fail.
so i think keep a default flavour in fallback.
what do you think ?
@samruddhi-Rahegaonkar yes i am figuring it out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Thanks, this topic is super tricky as we experienced in the past: In the past it also involved providing different manifest files for different versions. Please check if adjusting the manifest files is necessary for these builds too.
- Please ensure there is a fallback as mentioned in the other review.
Ok, I am merging this for further testing. |
@mariobehling i think we should revert this pr |
@nope3472 are you having trouble while updating beta app ? |
I am trying since last 5 minutes its not updating on Android 11. |
@samruddhi-Rahegaonkar @mariobehling I think this isn’t fully resolved yet. There are still some changes missing, and other PRs are failing because of it. We should revert this for now, and I’ll try again to fix it properly. Then we can proceed with this issue |
@nope3472 Yes we should. |
This reverts commit b744550.
Fixes #1340
Changes
android/app/build.gradle
:minSdkVersion 21
,targetSdkVersion 29
)minSdkVersion 30
,targetSdkVersion 34
)How to Build and Use the Two APK Versions:
For Android 10 and below:
flutter build apk --flavor preApi30 -t lib/main.dart
For Android 11 and above:
flutter build apk --flavor postApi30 -t lib/main.dart
Summary by Sourcery
Configure two Android build flavors to generate separate APKs for devices running pre-Android 11 (API 29) and Android 11+ (API 30–34) to satisfy F-Droid compatibility requirements.
New Features:
Enhancements: