Skip to content

Commit fe5dd86

Browse files
authored
Ensure Example Packages Work on Android API 36 (#9241)
Ensured the example plugin apps on Android work on Android API 36 by updating configurations and sucessfully running `flutter build apk` (means the app can successfully build + all dependencies are resolvable). For compatibility with Android API 36, the example plugin apps on Android should have the following configurations: `targetSdk`: 36 `compileSdk`: 36 AGP version: 8.9.1 Gradle version: 8.11.1 Most packages no longer require a manual bump of `targetSdk` and `compileSdk` due to usage of values from Flutter Gradle Plugin. Below is a list of example plugin apps on Android: Partially Adresses flutter/flutter#163071 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 2c14cf2 commit fe5dd86

File tree

114 files changed

+179
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+179
-106
lines changed

packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
6+

packages/animations/example/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pluginManagement {
2020
// See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
2121
plugins {
2222
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
23-
id "com.android.application" version "8.5.1" apply false
23+
id "com.android.application" version "8.9.1" apply false
2424
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
2525
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.1"
2626
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+

packages/camera/camera/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
6+

packages/camera/camera/example/android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pluginManagement {
1919
// See https://github.com/flutter/flutter/blob/master/docs/ecosystem/Plugins-and-Packages-repository-structure.md#gradle-structure for more info.
2020
plugins {
2121
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
22-
id "com.android.application" version "8.5.1" apply false
22+
id "com.android.application" version "8.9.1" apply false
2323
id "org.jetbrains.kotlin.android" version "1.9.0" apply false
2424
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.1"
2525

packages/camera/camera_android/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ buildFeatures {
3131
buildConfig true
3232
}
3333
namespace 'io.flutter.plugins.camera'
34-
compileSdk = flutter.compileSdkVersion
34+
compileSdk = 36
3535

3636
defaultConfig {
3737
minSdkVersion 21

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public CaptureRequest.Builder createCaptureRequest(int templateType)
152152
return cameraDevice.createCaptureRequest(templateType);
153153
}
154154

155+
@SuppressLint("UseRequiresApi")
155156
@TargetApi(VERSION_CODES.P)
156157
@Override
157158
public void createCaptureSession(SessionConfiguration config) throws CameraAccessException {
@@ -544,6 +545,7 @@ public void onClosed(@NonNull CameraCaptureSession session) {
544545
}
545546
}
546547

548+
@SuppressLint("UseRequiresApi")
547549
@TargetApi(VERSION_CODES.P)
548550
private void createCaptureSessionWithSessionConfig(
549551
List<OutputConfiguration> outputConfigs, CameraCaptureSession.StateCallback callback)

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraDeviceWrapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package io.flutter.plugins.camera;
66

7+
import android.annotation.SuppressLint;
78
import android.annotation.TargetApi;
89
import android.hardware.camera2.CameraAccessException;
910
import android.hardware.camera2.CameraCaptureSession;
@@ -21,6 +22,7 @@ interface CameraDeviceWrapper {
2122
@NonNull
2223
CaptureRequest.Builder createCaptureRequest(int templateType) throws CameraAccessException;
2324

25+
@SuppressLint("UseRequiresApi")
2426
@TargetApi(Build.VERSION_CODES.P)
2527
void createCaptureSession(SessionConfiguration config) throws CameraAccessException;
2628

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/CameraRegionUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package io.flutter.plugins.camera;
66

7+
import android.annotation.SuppressLint;
78
import android.annotation.TargetApi;
89
import android.hardware.camera2.CaptureRequest;
910
import android.hardware.camera2.params.MeteringRectangle;
@@ -126,6 +127,7 @@ public static MeteringRectangle convertPointToMeteringRectangle(
126127
return MeteringRectangleFactory.create(targetX, targetY, targetWidth, targetHeight, 1);
127128
}
128129

130+
@SuppressLint("UseRequiresApi")
129131
@TargetApi(Build.VERSION_CODES.P)
130132
private static boolean supportsDistortionCorrection(CameraProperties cameraProperties) {
131133
int[] availableDistortionCorrectionModes =

packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/features/resolution/ResolutionFeature.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ static Size computeBestPreviewSize(int cameraId, ResolutionPreset preset)
156156
* @return The best possible {@link android.media.CamcorderProfile} that matches the supplied
157157
* {@link ResolutionPreset}.
158158
*/
159+
@SuppressLint("UseRequiresApi")
159160
@TargetApi(Build.VERSION_CODES.R)
160161
// All of these cases deliberately fall through to get the best available profile.
161162
@SuppressWarnings({"fallthrough", "deprecation"})
@@ -208,6 +209,7 @@ public static CamcorderProfile getBestAvailableCamcorderProfileForResolutionPres
208209
}
209210
}
210211

212+
@SuppressLint("UseRequiresApi")
211213
@TargetApi(Build.VERSION_CODES.S)
212214
// All of these cases deliberately fall through to get the best available profile.
213215
@SuppressWarnings("fallthrough")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy