Skip to content

Commit 16558da

Browse files
committed
upgrading audio_streamer example app
1 parent e9a500a commit 16558da

13 files changed

Lines changed: 116 additions & 60 deletions

File tree

packages/audio_streamer/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 4.2.0
2+
3+
* Gradle files restructure for example app
4+
* Small upgrades to ios example app
5+
* Upgrading gradle version
6+
* Upgrading agp
7+
* Upgrading targetSdkVersion
8+
* Upgrading compileSdkVersion
9+
* Upgrading ndkVersion
10+
111
## 4.1.1
212

313
* enable AGP 8.0

packages/audio_streamer/android/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28-
compileSdkVersion 34
28+
compileSdkVersion flutter.compileSdkVersion
29+
ndkVersion flutter.ndkVersion
2930

3031
compileOptions {
3132
sourceCompatibility JavaVersion.VERSION_1_8
@@ -38,13 +39,16 @@ android {
3839
sourceSets {
3940
main.java.srcDirs += 'src/main/kotlin'
4041
}
42+
43+
lintOptions {
44+
disable 'InvalidPackage'
45+
}
46+
4147
defaultConfig {
4248
minSdkVersion 16
49+
targetSdkVersion flutter.targetSdkVersion
4350
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4451
}
45-
lintOptions {
46-
disable 'InvalidPackage'
47-
}
4852

4953
if (project.android.hasProperty("namespace")) {
5054
namespace 'plugins.cachet.audio_streamer'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
11
rootProject.name = 'audio_streamer'
2+
3+
pluginManagement {
4+
def flutterSdkPath = {
5+
def properties = new Properties()
6+
file("local.properties").withInputStream { properties.load(it) }
7+
def flutterSdkPath = properties.getProperty("flutter.sdk")
8+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
9+
return flutterSdkPath
10+
}()
11+
12+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
13+
14+
repositories {
15+
google()
16+
mavenCentral()
17+
gradlePluginPortal()
18+
}
19+
}
20+
21+
plugins {
22+
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
23+
id "com.android.application" version "8.1.0" apply false
24+
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
25+
}
26+
27+
include ":app"

packages/audio_streamer/example/android/app/build.gradle

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,9 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdk 34
26+
namespace 'plugins.cachet.audio_streamer_example'
27+
compileSdkVersion flutter.compileSdkVersion
3028

3129
sourceSets {
3230
main.java.srcDirs += 'src/main/kotlin'
@@ -36,14 +34,22 @@ android {
3634
sourceCompatibility JavaVersion.VERSION_1_8
3735
targetCompatibility JavaVersion.VERSION_1_8
3836
}
37+
38+
kotlinOptions {
39+
jvmTarget = '1.8'
40+
}
41+
42+
lint {
43+
disable 'InvalidPackage'
44+
}
3945

4046
defaultConfig {
4147
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4248
applicationId "plugins.cachet.audio_streamer_example"
4349
minSdkVersion 28
50+
targetSdkVersion flutter.targetSdkVersion
4451
versionCode flutterVersionCode.toInteger()
4552
versionName flutterVersionName
46-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4753
}
4854

4955
buildTypes {
@@ -53,21 +59,13 @@ android {
5359
signingConfig signingConfigs.debug
5460
}
5561
}
56-
lint {
57-
disable 'InvalidPackage'
58-
}
59-
kotlinOptions {
60-
jvmTarget = '1.8'
61-
}
62-
namespace 'plugins.cachet.audio_streamer_example'
6362
}
6463

6564
flutter {
6665
source '../..'
6766
}
6867

6968
dependencies {
70-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
7169
testImplementation 'junit:junit:4.13.2'
7270
androidTestImplementation 'androidx.test:runner:1.5.2'
7371
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

packages/audio_streamer/example/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.9.22'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:8.2.1'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Sun Mar 12 17:19:03 CST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
411

5-
def plugins = new Properties()
6-
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7-
if (pluginsFile.exists()) {
8-
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
917
}
1018

11-
plugins.each { name, path ->
12-
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13-
include ":$name"
14-
project(":$name").projectDir = pluginDirectory
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
21+
id "com.android.application" version "8.1.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
1523
}
24+
25+
include ":app"

packages/audio_streamer/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

packages/audio_streamer/example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
2+
# platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

packages/audio_streamer/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
9705A1C41CF9048500538489 /* Embed Frameworks */,
148148
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
149149
C8DCEBC0A311A81F291600C2 /* [CP] Embed Pods Frameworks */,
150+
B027207B6AEA34DF4256343D /* [CP] Copy Pods Resources */,
150151
);
151152
buildRules = (
152153
);
@@ -163,7 +164,7 @@
163164
97C146E61CF9000F007C117D /* Project object */ = {
164165
isa = PBXProject;
165166
attributes = {
166-
LastUpgradeCheck = 1300;
167+
LastUpgradeCheck = 1510;
167168
ORGANIZATIONNAME = "The Chromium Authors";
168169
TargetAttributes = {
169170
97C146ED1CF9000F007C117D = {
@@ -173,7 +174,7 @@
173174
};
174175
};
175176
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
176-
compatibilityVersion = "Xcode 3.2";
177+
compatibilityVersion = "Xcode 12.0";
177178
developmentRegion = en;
178179
hasScannedForEncodings = 0;
179180
knownRegions = (
@@ -212,6 +213,7 @@
212213
files = (
213214
);
214215
inputPaths = (
216+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
215217
);
216218
name = "Thin Binary";
217219
outputPaths = (
@@ -257,6 +259,24 @@
257259
shellPath = /bin/sh;
258260
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
259261
};
262+
B027207B6AEA34DF4256343D /* [CP] Copy Pods Resources */ = {
263+
isa = PBXShellScriptBuildPhase;
264+
buildActionMask = 2147483647;
265+
files = (
266+
);
267+
inputPaths = (
268+
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
269+
"${PODS_CONFIGURATION_BUILD_DIR}/permission_handler_apple/permission_handler_apple_privacy.bundle",
270+
);
271+
name = "[CP] Copy Pods Resources";
272+
outputPaths = (
273+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/permission_handler_apple_privacy.bundle",
274+
);
275+
runOnlyForDeploymentPostprocessing = 0;
276+
shellPath = /bin/sh;
277+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
278+
showEnvVarsInLog = 0;
279+
};
260280
C8DCEBC0A311A81F291600C2 /* [CP] Embed Pods Frameworks */ = {
261281
isa = PBXShellScriptBuildPhase;
262282
buildActionMask = 2147483647;
@@ -350,7 +370,7 @@
350370
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
351371
GCC_WARN_UNUSED_FUNCTION = YES;
352372
GCC_WARN_UNUSED_VARIABLE = YES;
353-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
373+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
354374
MTL_ENABLE_DEBUG_INFO = NO;
355375
SDKROOT = iphoneos;
356376
SUPPORTED_PLATFORMS = iphoneos;
@@ -373,7 +393,7 @@
373393
"$(PROJECT_DIR)/Flutter",
374394
);
375395
INFOPLIST_FILE = Runner/Info.plist;
376-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
396+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
377397
LD_RUNPATH_SEARCH_PATHS = (
378398
"$(inherited)",
379399
"@executable_path/Frameworks",
@@ -437,7 +457,7 @@
437457
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
438458
GCC_WARN_UNUSED_FUNCTION = YES;
439459
GCC_WARN_UNUSED_VARIABLE = YES;
440-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
460+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
441461
MTL_ENABLE_DEBUG_INFO = YES;
442462
ONLY_ACTIVE_ARCH = YES;
443463
SDKROOT = iphoneos;
@@ -486,7 +506,7 @@
486506
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
487507
GCC_WARN_UNUSED_FUNCTION = YES;
488508
GCC_WARN_UNUSED_VARIABLE = YES;
489-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
509+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
490510
MTL_ENABLE_DEBUG_INFO = NO;
491511
SDKROOT = iphoneos;
492512
SUPPORTED_PLATFORMS = iphoneos;
@@ -510,7 +530,7 @@
510530
"$(PROJECT_DIR)/Flutter",
511531
);
512532
INFOPLIST_FILE = Runner/Info.plist;
513-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
533+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
514534
LD_RUNPATH_SEARCH_PATHS = (
515535
"$(inherited)",
516536
"@executable_path/Frameworks",
@@ -542,7 +562,7 @@
542562
"$(PROJECT_DIR)/Flutter",
543563
);
544564
INFOPLIST_FILE = Runner/Info.plist;
545-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
565+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
546566
LD_RUNPATH_SEARCH_PATHS = (
547567
"$(inherited)",
548568
"@executable_path/Frameworks",

0 commit comments

Comments
 (0)