Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Maintenance & fixes (#964)
Browse files Browse the repository at this point in the history
## Description

### Maintenance
- Remove Firebase files to avoid crash reports from forks and update
Android and iOS Firebase app ID
- Fix Android crash due to missing crashlytics plugin
- Regenerate `android/app/src/main/AndroidManifest.xml`
- Update `android/crane/build.gradle`
- Update releasing instructions
- Remove Fastlane production lane for deploying directly to production
(use `beta` and `promote_to_production` instead)
- Regenerate Fastlane documentation
- Remove macOS from Firebase config
- Update `Runner.xcodeproj/project.pbxproj` and `pubspec` files

### Fixes
- Disable deferred components
(#926)
- Respect brightness of web for the background
- Adjust the logo transform animation on web
- Fix Android splash screen `backgroundColor` (Fixes
#930)

---

>**Note**: Please find the development and releasing instructions at
https://github.com/flutter/gallery#development
  • Loading branch information
guidezpl authored Jun 7, 2023
1 parent 544c290 commit d77920b
Show file tree
Hide file tree
Showing 25 changed files with 271 additions and 358 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ test_goldens/failures/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

**/google-services.json
**/GoogleService-Info.plist
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,29 +123,33 @@ determine how long to display the splash animation at launch.

## Releasing

<details>
<summary>for flutter-hackers members</summary>
*must be a `flutter-hackers` member*

The process is largely automated and easy to set in motion.
A set of GitHub workflows are available to help with releasing the Flutter Gallery, one per releasing platform.

First things first, bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
1. For Android, download the relevant [Firebase configuration file](https://firebase.corp.google.com/u/0/project/gallery-flutter-dev/settings/general) (e.g. `google-services.json`).
1. Bump the `pubspec.yaml` version number. This can be in a PR making a change or a separate PR.
Use [semantic versioning](https://semver.org/) to determine
which part to increment. The version number after the `+` should also be incremented. For example `1.2.3+010203`
which part to increment. **The version number after the `+` should also be incremented**. For example `1.2.3+010203`
with a patch should become `1.2.4+010204`.

Then, use the following workflows. It is strongly recommended to use the staging/beta environments when available, before deploying to production.

- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)), promote an existing beta to production, or publish straight to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)).
> **Note**
> Once an .aab is released with a particular version number, it can't be replaced. The version number must be incremented again.
1. Run GitHub workflow.
- [Deploy to web](https://github.com/flutter/gallery/actions/workflows/release_deploy_web.yml): Deploys a web build to the Firebase-hosted [staging](https://gallery-flutter-staging.web.app) or [production](https://gallery.flutter.dev) site.
- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including automatically generated release notes and packaged builds for Android, macOS, Linux, and Windows.
- [Deploy to Play Store](https://github.com/flutter/gallery/actions/workflows/release_deploy_play_store.yml): Uses Fastlane to create a [beta](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/open-testing) (freely available on the [Play Store](https://play.google.com/apps/testing/io.flutter.demo.gallery)) or promote an existing beta to [production](https://play.google.com/console/u/0/developers/7661132837216938445/app/4974617875198505129/tracks/production) ([Play Store](https://play.google.com/store/apps/details?id=io.flutter.demo.gallery)).
> **Note**
> Once an .aab is created with a particular version number, it can't be replaced. The pubspec version number must be incremented again.
- [Draft GitHub release](https://github.com/flutter/gallery/actions/workflows/release_draft_github_release.yml): Drafts a GitHub release, including packaged builds for Android, macOS, Linux, and Windows. Release notes can be automatically generated. The release draft is private until published. Upon being published, the specified version tag will be created.
- [Publish on Windows Store](): Releasing to the Windows Store.
> **Note**
> The release draft is private until published. Upon being published, the specified version tag will be created.
- [Publish on Windows Store](): A workflow file for releasing to the Windows Store. This repository is not currently set up to publish new versions of [the current Windows Store listing](https://www.microsoft.com/store/productId/9PDWCTDFC7QQ). Requires running `msstore init` within the repository and setting repository/environment secrets .
> This repository is not currently set up to publish new versions of [the current Windows Store listing](https://www.microsoft.com/store/productId/9PDWCTDFC7QQ). Requires running `msstore init` within the repository and setting repository/environment secrets .
> See the instructions in the [documentation](https://docs.flutter.dev/deployment/windows#github-actions-cicd) for more information.
For posterity, information about doing these things locally is available at [go/flutter-gallery-manual-deployment](http://go/flutter-gallery-manual-deployment).
<details>
<summary>Escape hatch</summary>

If the above GitHub workflows aren't functional (#759), releasing can be done semi-manually. Since this requires obtaining environment secrets, this can only be done by a Googler. See go/flutter-gallery-manual-deployment.


</details>

Expand Down
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.firebase.crashlytics"
}

def localProperties = new Properties()
Expand Down
40 changes: 0 additions & 40 deletions android/app/google-services.json

This file was deleted.

74 changes: 37 additions & 37 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:label="Flutter Gallery"
android:name="io.flutter.embedding.android.FlutterPlayStoreSplitApplication"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
<application
android:name="io.flutter.embedding.android.FlutterPlayStoreSplitApplication"
android:icon="@mipmap/ic_launcher"
android:label="Flutter Gallery">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- Don't delete the meta-data below.
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2"/>
</activity>
<meta-data android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping" android:value="77:crane,2:,3:,4:,5:,6:,7:,8:,9:,10:,11:,12:,13:,14:,15:,16:,17:,18:,19:,20:,21:,22:,23:,24:,25:,26:,27:,28:,29:,30:,31:,32:,33:,34:,35:,36:,37:,38:,39:,40:,41:,42:,43:,44:,45:,46:,47:,48:,49:,50:,51:,52:,53:,54:,55:,56:,57:,58:,59:,60:,61:,62:,63:,64:,65:,66:,67:,68:,69:,70:,71:,72:,73:,74:,75:,76:,78:,79:,80:,81:,82:,83:,84:,85:,86:,87:"/>
</application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</activity>
<meta-data
android:name="io.flutter.embedding.engine.deferredcomponents.DeferredComponentManager.loadingUnitMapping"
android:value="78:crane,2:,3:,4:,5:,6:,7:,8:,9:,10:,11:,12:,13:,14:,15:,16:,17:,18:,19:,20:,21:,22:,23:,24:,25:,26:,27:,28:,29:,30:,31:,32:,33:,34:,35:,36:,37:,38:,39:,40:,41:,42:,43:,44:,45:,46:,47:,48:,49:,50:,51:,52:,53:,54:,55:,56:,57:,58:,59:,60:,61:,62:,63:,64:,65:,66:,67:,68:,69:,70:,71:,72:,73:,74:,75:,76:,77:,79:,80:,81:,82:,83:,84:,85:,86:,87:,88:" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
</queries>
</manifest>
4 changes: 3 additions & 1 deletion android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowSplashScreenBackground">@color/backgroundColor</item>
</style>
<color name="backgroundColor">#241E30</color>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
<item name="android:windowSplashScreenBackground">@color/backgroundColor</item>
</style>
<color name="backgroundColor">#030303</color>
<color name="backgroundColor">#E6EBEB</color>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
Expand Down
24 changes: 16 additions & 8 deletions android/crane/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
plugins {
id "com.android.dynamic-feature"
id "kotlin-android"
id "com.google.firebase.crashlytics"
}

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: "com.android.dynamic-feature"

android {
namespace "com.example.gallery.crane"
namespace "io.flutter.demo.gallery.crane"
compileSdkVersion 31

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
applicationVariants.all { variant ->
main.assets.srcDirs += "${project.buildDir}/intermediates/flutter/${variant.name}/deferred_assets"
Expand All @@ -20,11 +33,6 @@ android {
defaultConfig {
minSdkVersion 21
}

compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}

dependencies {
Expand Down
13 changes: 2 additions & 11 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ platform :android do

desc "Submit a new beta build to Google Play"
lane :beta do
sh "flutter build appbundle -v"
# TODO: Re-enable deferred components once https://github.com/flutter/gallery/issues/926 is fixed
sh "flutter build appbundle -v --no-deferred-components"
upload_to_play_store(
track: 'beta',
aab: '../build/app/outputs/bundle/release/app-release.aab',
Expand All @@ -40,14 +41,4 @@ platform :android do
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
)
end

desc "Submit a new production build to Google Play"
lane :production do
sh "flutter build appbundle -v"
upload_to_play_store(
track: 'production',
aab: '../build/app/outputs/bundle/release/app-release.aab',
json_key_data: ENV['PLAY_STORE_CONFIG_JSON'],
)
end
end
46 changes: 25 additions & 21 deletions android/fastlane/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,48 @@
fastlane documentation
================
----

# Installation

Make sure you have the latest version of the Xcode command line tools installed:

```
```sh
xcode-select --install
```

Install _fastlane_ using
```
[sudo] gem install fastlane -NV
```
or alternatively using `brew install fastlane`
For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane)

# Available Actions

## Android

### android test

```sh
[bundle exec] fastlane android test
```
fastlane android test
```

Runs all the tests

### android beta

```sh
[bundle exec] fastlane android beta
```
fastlane android beta
```

Submit a new beta build to Google Play

### android promote_to_production

```sh
[bundle exec] fastlane android promote_to_production
```
fastlane android promote_to_production
```

Promote beta track to prod
### android production
```
fastlane android production
```
Submit a new production build to Google Play

----

This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools).

The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
Loading

0 comments on commit d77920b

Please sign in to comment.