Skip to content

Commit 2540b76

Browse files
authored
Merge pull request #294 from bhanuka96/main
Add Android 16KB Page Size Support for Google Play 2025 Requirement
2 parents 9b3a779 + 673978f commit 2540b76

File tree

59 files changed

+399
-201
lines changed

Some content is hidden

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

59 files changed

+399
-201
lines changed

android/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111

1212
dependencies {
1313
// The Android Gradle Plugin knows how to build native code with the NDK.
14-
classpath 'com.android.tools.build:gradle:7.3.0'
14+
classpath 'com.android.tools.build:gradle:8.6.1'
1515
}
1616
}
1717

@@ -27,12 +27,13 @@ apply plugin: 'com.android.library'
2727
android {
2828
// Bumping the plugin compileSdkVersion requires all clients of this plugin
2929
// to bump the version in their app.
30-
compileSdkVersion 31
30+
compileSdkVersion 36
3131
namespace 'org.tensorflow.tflite_flutter'
3232

3333
// Bumping the plugin ndkVersion requires all clients of this plugin to bump
3434
// the version in their app and to download a newer version of the NDK.
35-
// ndkVersion "23.1.7779620"
35+
// Use NDK r27 or higher for 16KB page size support
36+
// ndkVersion "28.0.12433566"
3637

3738
// Invoke the shared CMake build with the Android Gradle Plugin.
3839
externalNativeBuild {
@@ -56,13 +57,14 @@ android {
5657

5758
defaultConfig {
5859
minSdkVersion 19
60+
5961
}
6062
}
6163

6264

6365
dependencies {
64-
def tflite_version = "2.11.0"
65-
66+
def tflite_version = "2.12.0"
67+
6668
implementation("org.tensorflow:tensorflow-lite:${tflite_version}")
6769
implementation("org.tensorflow:tensorflow-lite-gpu:${tflite_version}")
6870
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

example/audio_classification/android/app/build.gradle

Lines changed: 8 additions & 5 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()) {
@@ -21,10 +27,6 @@ if (flutterVersionName == null) {
2127
flutterVersionName = '1.0'
2228
}
2329

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2830
android {
2931
namespace "org.tensorflow.audio_classification.audio_classification"
3032
compileSdkVersion flutter.compileSdkVersion
@@ -49,10 +51,11 @@ android {
4951
// You can update the following values to match your application needs.
5052
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
5153
// minSdkVersion flutter.minSdkVersion
52-
minSdkVersion 23
54+
minSdkVersion flutter.minSdkVersion
5355
targetSdkVersion flutter.targetSdkVersion
5456
versionCode flutterVersionCode.toInteger()
5557
versionName flutterVersionName
58+
5659
}
5760

5861
buildTypes {

example/audio_classification/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.7.10'
2+
ext.kotlin_version = '1.8.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
9+
classpath 'com.android.tools.build:gradle:8.5.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/audio_classification/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ 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-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +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 localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.6.1" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
23+
}
24+
25+
include ":app"

example/bertqa/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ android {
4949
targetSdkVersion flutter.targetSdkVersion
5050
versionCode flutterVersionCode.toInteger()
5151
versionName flutterVersionName
52+
5253
}
5354

5455
buildTypes {

example/bertqa/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.7.10'
2+
ext.kotlin_version = '1.8.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
9+
classpath 'com.android.tools.build:gradle:8.5.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}

example/bertqa/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ 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-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip

example/bertqa/android/settings.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@ pluginManagement {
55
def flutterSdkPath = properties.getProperty("flutter.sdk")
66
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
77
return flutterSdkPath
8-
}
9-
settings.ext.flutterSdkPath = flutterSdkPath()
8+
}()
109

11-
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
1211

13-
plugins {
14-
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
1516
}
1617
}
1718

18-
include ":app"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "8.6.1" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
23+
}
1924

20-
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
25+
include ":app"

0 commit comments

Comments
 (0)