1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2026-08-25 01:05:36 +00:00

fix: make every Android app build again

- Add the missing flutterEmbedding v2 meta-data to 8 manifests that still
  used the removed v1 embedding
- Drop stale package attributes from covid19_mobile_app debug/profile
  manifests that conflicted with its namespace
- Override gallery_saver_plus's hardcoded compileSdk 31 in image_editor so
  its dependencies resolve (documented AAR metadata check now passes)
- Document that the three Firebase apps need a developer-provided
  google-services.json before they can build
This commit is contained in:
Nishant Srivastava
2026-08-17 23:41:25 +02:00
parent 5c53498119
commit 47bc829f64
12 changed files with 73 additions and 44 deletions

View File

@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="com.example.covid19_mobile_app">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="com.example.covid19_mobile_app">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

View File

@@ -30,6 +30,18 @@ make gradle-update FORCE=1 # latest version, force update
make gradle-update VERSION=9.7.0 FORCE=1 # specific version, force update make gradle-update VERSION=9.7.0 FORCE=1 # specific version, force update
``` ```
## Firebase apps
These apps connect to Firebase and need a developer-provided `google-services.json`
in `<app>/android/app/` before they can be built:
- `firebase_google_authentication`
- `google_signin`
- `using_firebase_db`
The file is never committed because it contains your Firebase project config.
Create a Firebase project for each app and download the file from the Firebase console.
## Requirements ## Requirements
- `make` (preinstalled on macOS and most Linux systems) - `make` (preinstalled on macOS and most Linux systems)

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="dropdown_button" android:label="dropdown_button"
@@ -34,5 +29,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="enabling_splash_screen" android:label="enabling_splash_screen"
@@ -34,5 +29,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -1,11 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
> >
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="expense_planner" android:label="expense_planner"
@@ -28,5 +23,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="google_signin" android:label="google_signin"
@@ -34,5 +29,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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:name="${applicationName}" android:label="handling_routes" android:icon="@mipmap/ic_launcher"> <application android:name="${applicationName}" android:label="handling_routes" android:icon="@mipmap/ic_launcher">
<activity android:name="io.flutter.embedding.android.FlutterActivity" <activity android:name="io.flutter.embedding.android.FlutterActivity"
android:exported="true" android:exported="true"
@@ -25,5 +20,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -16,6 +16,17 @@ subprojects {
project.layout.buildDirectory.value(newSubprojectBuildDir) project.layout.buildDirectory.value(newSubprojectBuildDir)
} }
subprojects { subprojects {
// gallery_saver_plus hardcodes compileSdk 31, which its dependencies no
// longer support. Register the override before forcing :app evaluation so
// it runs after each library script has set its own value.
project.afterEvaluate {
if (project.plugins.hasPlugin("com.android.library")) {
val appSdk = (project(":app").extensions.getByName("android")
as com.android.build.api.dsl.ApplicationExtension).compileSdk
(project.extensions.getByName("android")
as com.android.build.api.dsl.LibraryExtension).compileSdk = appSdk
}
}
project.evaluationDependsOn(":app") project.evaluationDependsOn(":app")
} }

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="image_from_network" android:label="image_from_network"
@@ -34,5 +29,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -7,11 +7,6 @@
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="infinite_list" android:label="infinite_list"
@@ -34,5 +29,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>

View File

@@ -1,11 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
> >
<!-- 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 <application
android:name="${applicationName}" android:name="${applicationName}"
android:label="using_firebase_db" android:label="using_firebase_db"
@@ -28,5 +23,11 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<!-- 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" />
</application> </application>
</manifest> </manifest>