diff --git a/.dart_tool/version b/.dart_tool/version index 5436ea06..40fc7267 100644 --- a/.dart_tool/version +++ b/.dart_tool/version @@ -1 +1 @@ -3.3.2 \ No newline at end of file +3.32.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 184912cf..f435df83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.0.1-45 - Jun 10, 2025 +- Update Android to embedding v2 + # 1.0.1-44 - May 28, 2025 - Update Android to v11.5.0 diff --git a/README.md b/README.md index b766da0f..e58acd95 100644 --- a/README.md +++ b/README.md @@ -80,44 +80,32 @@ The following instructions are only applicable to Android development; click her ```diff defaultConfig { applicationId "com.example.myapp" - - minSdkVersion flutter.minSdkVersion - + minSdkVersion 21 - + multiDexEnabled true - + manifestPlaceholders += [pdftronLicenseKey:PDFTRON_LICENSE_KEY] targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName + + + resValue("string", "PDFTRON_LICENSE_KEY", "\"LICENSE_KEY_GOES_HERE\"") } ``` - -5. In your `myapp/android/gradle.properties` file, add the following line: - ``` diff - # Add the PDFTRON_LICENSE_KEY variable here. - # For trial purposes leave it blank. - # For production add a valid commercial license key. - PDFTRON_LICENSE_KEY= - ``` -6. In your `myapp/android/app/src/main/AndroidManifest.xml` file, add the following lines: +5. In your `myapp/android/app/src/main/AndroidManifest.xml` file, add the following lines: ```diff + + - - + + + + android:largeHeap="true"> + + + android:value="@string/PDFTRON_LICENSE_KEY" /> ... ``` @@ -135,9 +123,9 @@ The following instructions are only applicable to Android development; click her } ``` -7. Follow the instructions outlined [in the Usage section](#usage). -8. Check that your Android device is running by running the command `flutter devices`. If none are available, follow the device set up instructions in the [Install](https://flutter.io/docs/get-started/install) guides for your platform. -9. Run the app with the command `flutter run`. +6. Follow the instructions outlined [in the Usage section](#usage). +7. Check that your Android device is running by running the command `flutter devices`. If none are available, follow the device set up instructions in the [Install](https://flutter.io/docs/get-started/install) guides for your platform. +8. Run the app with the command `flutter run`. ### iOS diff --git a/android/build.gradle b/android/build.gradle index 321deba3..e429127d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.pdftron.pdftronflutter' -version '2.0' +version '3.0.0' buildscript { repositories { @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.2.0' + classpath 'com.android.tools.build:gradle:8.0.2' } } @@ -30,7 +30,7 @@ android { compileSdk 34 defaultConfig { - minSdkVersion 19 + minSdk = 21 vectorDrawables.useSupportLibrary = true } lintOptions { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index be4b5993..ace89def 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -3,6 +3,10 @@ + + - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - compileSdkVersion 34 - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - applicationId "com.pdftron.pdftronflutterexample" - minSdkVersion 21 - targetSdkVersion 34 - multiDexEnabled true - manifestPlaceholders += [pdftronLicenseKey:PDFTRON_LICENSE_KEY] - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "androidx.appcompat:appcompat:1.3.1" - implementation "com.google.android.material:material:1.5.0" - - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.2.0' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' -} diff --git a/example/android/app/build.gradle.kts b/example/android/app/build.gradle.kts new file mode 100644 index 00000000..a3cef125 --- /dev/null +++ b/example/android/app/build.gradle.kts @@ -0,0 +1,46 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.pdftron.pdftronflutterexample" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.pdftron.pdftronflutterexample" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + + resValue("string", "PDFTRON_LICENSE_KEY", "\"LICENSE_KEY_GOES_HERE\"") + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..399f6981 --- /dev/null +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index a67a2725..d6a49d91 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,30 +1,25 @@ - + - - + android:icon="@mipmap/ic_launcher"> - + android:value="@string/PDFTRON_LICENSE_KEY" /> @@ -33,20 +28,29 @@ while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. --> + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" + /> - - + + - - + + + + + + + diff --git a/example/android/app/src/main/java/com/pdftron/pdftronflutterexample/MainActivity.java b/example/android/app/src/main/java/com/pdftron/pdftronflutterexample/MainActivity.java deleted file mode 100644 index a4d6d386..00000000 --- a/example/android/app/src/main/java/com/pdftron/pdftronflutterexample/MainActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.pdftron.pdftronflutterexample; - -import androidx.annotation.NonNull; - -import io.flutter.embedding.android.FlutterFragmentActivity; -import io.flutter.embedding.engine.FlutterEngine; -import io.flutter.plugins.GeneratedPluginRegistrant; - -public class MainActivity extends FlutterFragmentActivity { - - @Override - public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine); - } -} diff --git a/example/android/app/src/main/kotlin/com/pdftron/pdftronflutterexample/MainActivity.kt b/example/android/app/src/main/kotlin/com/pdftron/pdftronflutterexample/MainActivity.kt new file mode 100644 index 00000000..826fb74f --- /dev/null +++ b/example/android/app/src/main/kotlin/com/pdftron/pdftronflutterexample/MainActivity.kt @@ -0,0 +1,5 @@ +package com.pdftron.pdftronflutterexample + +import io.flutter.embedding.android.FlutterFragmentActivity + +class MainActivity : FlutterFragmentActivity() diff --git a/example/android/app/src/main/res/drawable-v21/launch_background.xml b/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 00000000..f74085f3 --- /dev/null +++ b/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/example/android/app/src/main/res/values-night/styles.xml b/example/android/app/src/main/res/values-night/styles.xml index e66c7e97..06952be7 100644 --- a/example/android/app/src/main/res/values-night/styles.xml +++ b/example/android/app/src/main/res/values-night/styles.xml @@ -1,11 +1,18 @@ - - + + diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml index 746a9bad..cb1ef880 100644 --- a/example/android/app/src/main/res/values/styles.xml +++ b/example/android/app/src/main/res/values/styles.xml @@ -1,17 +1,11 @@ - - - - + + diff --git a/example/android/build.gradle b/example/android/build.gradle deleted file mode 100644 index bc157bd1..00000000 --- a/example/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/example/android/build.gradle.kts b/example/android/build.gradle.kts new file mode 100644 index 00000000..89176ef4 --- /dev/null +++ b/example/android/build.gradle.kts @@ -0,0 +1,21 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/example/android/gradle.properties b/example/android/gradle.properties index b8de59af..24863d21 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,10 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M - -# If you're using the permission_handler package, also add these two lines +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true - -# Add the PDFTRON_LICENSE_KEY variable here. -# For trial purposes leave it blank. -# For production add a valid commercial license key. -PDFTRON_LICENSE_KEY= +android.enableJetifier=true \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index bbe84e82..ac3b4792 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jul 10 15:58:56 PDT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle deleted file mode 100644 index a7f13a03..00000000 --- a/example/android/settings.gradle +++ /dev/null @@ -1,24 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.1.2" apply false -} - -include ":app" \ No newline at end of file diff --git a/example/android/settings.gradle.kts b/example/android/settings.gradle.kts new file mode 100644 index 00000000..ab39a10a --- /dev/null +++ b/example/android/settings.gradle.kts @@ -0,0 +1,25 @@ +pluginManagement { + val flutterSdkPath = run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.7.3" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/example/pubspec.yaml b/example/pubspec.yaml index cf25f171..604cc59c 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,13 +6,15 @@ version: 1.0.0+1 publish_to: 'none' environment: - sdk: ">=2.17.5 <3.0.0" - flutter: ">=1.12.0" + sdk: ^3.8.0 dependencies: flutter: sdk: flutter + pdftron_flutter: + path: ../ + # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 @@ -21,9 +23,6 @@ dev_dependencies: flutter_test: sdk: flutter - pdftron_flutter: - path: ../ - # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/pubspec.yaml b/pubspec.yaml index 6e361d8b..4dbc9e90 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pdftron_flutter description: A convenience wrapper to build Flutter apps that use the PDFTron mobile SDK for smooth, flexible, and stand-alone document viewing. -version: 1.0.1-44 +version: 1.0.1-45 homepage: https://www.apryse.com repository: https://github.com/ApryseSDK/pdftron-flutter issue_tracker: https://github.com/ApryseSDK/pdftron-flutter/issues