fix: solve issue that sdk can not be compiled on android platform #203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
flutter bulid apk
command on build machine that Flutter 3.24.0 or later is installed.Why?
Flutter app project using Amplitude-Flutter cannot be compiled with
flutter bulid apk
command on build machine that Flutter 3.24.0 or later is installed.Because on Flutter 3.24.0, it upgrades AndroidX dependencies that requires compileSdkVersion 31 but Amplitude-Flutter use 28.
To fix this issue Amplitude-Flutter should change compileSdkVersion to 31 or later.
Change compileSdkVersion to 31 or later on flutter app project do not fix the problem.
How to reproduce problem?
Run command below.
flutter upgrade flutter create test_amplitude --platform android cd test_amplitude flutter pub add amplitude_flutter flutter pub get flutter build apk
Then below error is occurred
Cause of problem
Flutter 3.24.0 upgrades AndroidX dependencies that requires compileSdkVersion 31.
Refer comment from Flutter issue flutter/flutter#153281 (comment).
Solution
Update Amplitude-Flutter's compileSdkVersion to 31.