Skip to content
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

chore: Modernise Android build config for plugin and example #29

Merged
merged 2 commits into from
Jun 9, 2022
Merged

chore: Modernise Android build config for plugin and example #29

merged 2 commits into from
Jun 9, 2022

Conversation

vbuberen
Copy link
Contributor

While going through the source code in the repo I saw that plugin and example app both have quiet outdated Android build configuration and decided to help bring it up to date a little bit.

  • Updated used Android Gradle plugin to 7.2.0 in both plugin and example, which is latest at the moment. Needed to be able to build project in latest Android Studio versions as 3.2 is already minimal supported version: https://developer.android.com/studio/releases/gradle-plugin
  • Updated Gradle wrapper version to the latest 7.4.2 in both plugin and example as after changing version Android Gradle version we had to update wrapper anyway.
  • Changed compileSDK to 31 for plugin and targetSDK for example to compile against currently latest Android SDK.
  • Added exported=true in AndroidManifest of example as it is a requirement in SDK 31.
  • Changed AndroidManifest in example to declare app name as android:name="${applicationName}" to not have build issues saying that example uses Flutter embedding V1.
  • Added android.useAndroidX=true flag as project has dependencies which use AndroidX, but doesn't enable AndroidX usage itself, so you can see following warnings during build:

androidxIssues

P.S. pubspec.lock versions changed because I was building the project after my changes and had to do pub.get. Version bump for Dart happened because I use latest stable versions of Dart and Flutter. These updates would need to happen anyway, so didn't revert them.

.gitignore Show resolved Hide resolved
@danielgomezrico danielgomezrico self-requested a review May 14, 2022 17:47
Copy link
Contributor

@danielgomezrico danielgomezrico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this 👍🏻

@vbuberen
Copy link
Contributor Author

vbuberen commented May 14, 2022

Build Android job fails due to Github Actions using Flutter 2.0.0, which couldn't work with Gradle 7 and newer.

Here is the issue in the Flutter repo with fix, which adds the compatibility: flutter/flutter#79167

Thus, will update version of Flutter used on CI in this PR as well to make all actions pass.

@danielgomezrico
Copy link
Contributor

@vbuberen what are the consequences of updating the library to flutter 3.0?

@vbuberen
Copy link
Contributor Author

In the context of this PR nothing changes for the project because of building with Dart 2.17 and Flutter 3 as I introduced no new code or features, which appeared only in mentioned releases.

In case you would like to check yourself here are links with release notes descriptions:
https://docs.flutter.dev/development/tools/sdk/release-notes/release-notes-3.0.0
https://medium.com/dartlang/dart-2-17-b216bfc80c5d

@vbuberen
Copy link
Contributor Author

vbuberen commented Jun 9, 2022

@danielgomezrico Do you you want me to address something else in this PR or it can be merged?
Would like to open one more PR with some Segment Android SDK updates, but feel like we might want to merge this one first.

Copy link
Contributor

@danielgomezrico danielgomezrico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vbuberen
Copy link
Contributor Author

vbuberen commented Jun 9, 2022

Thanks for approval. I was curios more on when this PR will be merged 😄

@danielgomezrico danielgomezrico merged commit 309729c into la-haus:master Jun 9, 2022
@danielgomezrico
Copy link
Contributor

@vbuberen LGTM thanks for opening the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants