From 41bcae754e0b3a46f394e2e596a44b6d7a476b13 Mon Sep 17 00:00:00 2001 From: yaakovschectman <109111084+yaakovschectman@users.noreply.github.com> Date: Fri, 8 Nov 2024 20:59:17 -0500 Subject: [PATCH] Remove v1 embedding (#543) * Upgrade example app * Remove v1 embedding * Remove android:name * Bumps version --- CHANGELOG.md | 4 ++ android/src/main/AndroidManifest.xml | 3 +- .../toast/fluttertoast/FlutterToastPlugin.kt | 3 -- .../fluttertoast/MethodCallHandlerImpl.kt | 7 ++- example/android/app/build.gradle | 3 +- .../android/app/src/debug/AndroidManifest.xml | 3 +- .../android/app/src/main/AndroidManifest.xml | 4 +- .../app/src/profile/AndroidManifest.xml | 3 +- example/android/build.gradle | 2 +- example/android/gradle.properties | 3 ++ .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/pubspec.lock | 46 +++++++++---------- pubspec.yaml | 2 +- 13 files changed, 42 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7ffdf4f..c1af0b76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [8.2.9] + +- Removes references to Flutter v1 android embedding classes. + ## [8.2.8] - Merged multiple PRs thanks for your contributions diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index e68b9d7b..a2f47b60 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1,2 @@ - + diff --git a/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/FlutterToastPlugin.kt b/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/FlutterToastPlugin.kt index 600dcebe..b2e6e6e6 100644 --- a/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/FlutterToastPlugin.kt +++ b/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/FlutterToastPlugin.kt @@ -1,12 +1,9 @@ package io.github.ponnamkarthik.toast.fluttertoast import android.content.Context -import androidx.annotation.NonNull import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.PluginRegistry.Registrar /** FlutterToastPlugin */ public class FlutterToastPlugin: FlutterPlugin { diff --git a/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt b/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt index 0f2c7552..2211bda3 100644 --- a/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt +++ b/android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt @@ -12,11 +12,10 @@ import android.view.LayoutInflater import android.widget.TextView import android.widget.Toast import androidx.core.content.ContextCompat +import io.flutter.FlutterInjector import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler -import io.flutter.view.FlutterMain -import java.io.File internal class MethodCallHandlerImpl(private var context: Context) : MethodCallHandler { @@ -71,7 +70,7 @@ internal class MethodCallHandlerImpl(private var context: Context) : MethodCallH if (fontAsset != null) { val assetManager: AssetManager = context.assets - val key = FlutterMain.getLookupKeyForAsset(fontAsset) + val key = FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(fontAsset) text.typeface = Typeface.createFromAsset(assetManager, key); } mToast?.view = layout @@ -87,7 +86,7 @@ internal class MethodCallHandlerImpl(private var context: Context) : MethodCallH } if (fontAsset != null) { val assetManager: AssetManager = context.assets - val key = FlutterMain.getLookupKeyForAsset(fontAsset) + val key = FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(fontAsset) textView.typeface = Typeface.createFromAsset(assetManager, key); } } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index ef7cb5a4..555c1523 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 33 + compileSdkVersion 34 ndkVersion flutter.ndkVersion compileOptions { @@ -60,6 +60,7 @@ android { signingConfig signingConfigs.debug } } + namespace 'com.example.example' } flutter { diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index 45d523a2..399f6981 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - +