diff --git a/lite/examples/optical_character_recognition/android/app/build.gradle b/lite/examples/optical_character_recognition/android/app/build.gradle index 311a2c62493..12686db8fed 100644 --- a/lite/examples/optical_character_recognition/android/app/build.gradle +++ b/lite/examples/optical_character_recognition/android/app/build.gradle @@ -20,12 +20,17 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { - compileSdkVersion 29 - buildToolsVersion "29.0.2" + buildFeatures { + viewBinding = true + } + compileSdk 34 + namespace = "org.tensorflow.lite.examples.ocr" + testNamespace = "org.tensorflow.lite.examples.ocr.test" defaultConfig { applicationId "org.tensorflow.lite.examples.ocr" minSdkVersion 21 - targetSdkVersion 29 + multiDexEnabled true + targetSdkVersion 34 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -86,3 +91,4 @@ dependencies { implementation 'com.quickbirdstudios:opencv:4.5.3.0' } + diff --git a/lite/examples/optical_character_recognition/android/app/src/main/AndroidManifest.xml b/lite/examples/optical_character_recognition/android/app/src/main/AndroidManifest.xml index de4dfb5906e..131b51fda94 100644 --- a/lite/examples/optical_character_recognition/android/app/src/main/AndroidManifest.xml +++ b/lite/examples/optical_character_recognition/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/lite/examples/optical_character_recognition/android/app/src/main/res/layout/tfe_is_activity_main.xml b/lite/examples/optical_character_recognition/android/app/src/main/res/layout/tfe_is_activity_main.xml index ac3c9655071..d54076bd477 100644 --- a/lite/examples/optical_character_recognition/android/app/src/main/res/layout/tfe_is_activity_main.xml +++ b/lite/examples/optical_character_recognition/android/app/src/main/res/layout/tfe_is_activity_main.xml @@ -72,8 +72,8 @@ android:contentDescription="@string/tfe_result_image_description" android:padding="8dp" /> + - diff --git a/lite/examples/optical_character_recognition/android/app/src/main/res/values/dimens.xml b/lite/examples/optical_character_recognition/android/app/src/main/res/values/dimens.xml index fda292b137c..33ab84aee66 100644 --- a/lite/examples/optical_character_recognition/android/app/src/main/res/values/dimens.xml +++ b/lite/examples/optical_character_recognition/android/app/src/main/res/values/dimens.xml @@ -1,6 +1,6 @@ - 250dp + 150dp 15dp 8dp diff --git a/lite/examples/optical_character_recognition/android/build.gradle b/lite/examples/optical_character_recognition/android/build.gradle index cec5c39130a..3af1cbf3d36 100644 --- a/lite/examples/optical_character_recognition/android/build.gradle +++ b/lite/examples/optical_character_recognition/android/build.gradle @@ -16,15 +16,20 @@ limitations under the License. // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.5.30-M1' + ext { + + agp_version1 = '8.1.4' + agp_version = '8.1.4' + } + ext.kotlin_version = '1.6.21' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath "com.android.tools.build:gradle:$agp_version1" classpath 'de.undercouch:gradle-download-task:4.0.2' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/lite/examples/optical_character_recognition/android/gradle.properties b/lite/examples/optical_character_recognition/android/gradle.properties index 52f5917cb0d..193a5b26e77 100644 --- a/lite/examples/optical_character_recognition/android/gradle.properties +++ b/lite/examples/optical_character_recognition/android/gradle.properties @@ -16,4 +16,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/lite/examples/optical_character_recognition/android/gradle/wrapper/gradle-wrapper.properties b/lite/examples/optical_character_recognition/android/gradle/wrapper/gradle-wrapper.properties index 3fa8f862f75..1dd0aee860f 100644 --- a/lite/examples/optical_character_recognition/android/gradle/wrapper/gradle-wrapper.properties +++ b/lite/examples/optical_character_recognition/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ +#Wed Nov 22 03:33:34 EST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME