diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460d..00000000
--- a/android/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/android/build.gradle b/android/build.gradle
index f0f02e7a..856ec608 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -2,41 +2,55 @@ group 'com.amolg.flutterbarcodescanner'
version '1.0-SNAPSHOT'
buildscript {
+ ext.kotlin_version = '1.9.0'
repositories {
google()
- jcenter()
+ mavenCentral()
}
-
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.3'
+ classpath "com.android.tools.build:gradle:7.4.0"
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
-rootProject.allprojects {
+allprojects {
repositories {
google()
- jcenter()
+ mavenCentral()
}
}
apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
android {
- compileSdkVersion 30
+ compileSdkVersion 34
+ namespace 'com.amolg.flutterbarcodescanner'
defaultConfig {
- minSdkVersion 16
- targetSdkVersion 30
+ minSdkVersion 19
+ targetSdkVersion 34
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
- lintOptions {
+
+ lint {
disable 'InvalidPackage'
+ warning 'deprecation'
+ warning 'unchecked'
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.gms:play-services-vision:20.1.3'
-}
\ No newline at end of file
+}
+
+
diff --git a/android/gradle.properties b/android/gradle.properties
index 53ae0ae4..deb6b802 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,3 +1,4 @@
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M
+org.gradle.warning.mode=all
\ No newline at end of file
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 9474641a..bb49de81 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index 5d6847be..808af1b1 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,5 +1,4 @@
-
+
diff --git a/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java b/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java
index 91480647..66d92b30 100644
--- a/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java
+++ b/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java
@@ -16,7 +16,8 @@
import java.util.Map;
-import io.flutter.embedding.android.FlutterActivity;
+// Added new FlutterFragmentActivity Here
+import io.flutter.embedding.android.FlutterFragmentActivity;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.embedding.engine.plugins.activity.ActivityAware;
@@ -39,7 +40,7 @@
public class FlutterBarcodeScannerPlugin implements MethodCallHandler, ActivityResultListener, StreamHandler, FlutterPlugin, ActivityAware {
private static final String CHANNEL = "flutter_barcode_scanner";
- private static FlutterActivity activity;
+ private static FlutterFragmentActivity activity;
private static Result pendingResult;
private Map arguments;
@@ -68,7 +69,7 @@ public class FlutterBarcodeScannerPlugin implements MethodCallHandler, ActivityR
public FlutterBarcodeScannerPlugin() {
}
- private FlutterBarcodeScannerPlugin(FlutterActivity activity, final PluginRegistry.Registrar registrar) {
+ private FlutterBarcodeScannerPlugin(FlutterFragmentActivity activity, final PluginRegistry.Registrar registrar) {
FlutterBarcodeScannerPlugin.activity = activity;
}
@@ -84,7 +85,7 @@ public static void registerWith(final PluginRegistry.Registrar registrar) {
if (registrar.context() != null) {
applicationContext = (Application) (registrar.context().getApplicationContext());
}
- FlutterBarcodeScannerPlugin instance = new FlutterBarcodeScannerPlugin((FlutterActivity) registrar.activity(), registrar);
+ FlutterBarcodeScannerPlugin instance = new FlutterBarcodeScannerPlugin((FlutterFragmentActivity) registrar.activity(), registrar);
instance.createPluginSetup(registrar.messenger(), applicationContext, activity, registrar, null);
}
@@ -245,7 +246,7 @@ private void createPluginSetup(
final ActivityPluginBinding activityBinding) {
- this.activity = (FlutterActivity) activity;
+ this.activity = (FlutterFragmentActivity) activity;
eventChannel =
new EventChannel(messenger, "flutter_barcode_scanner_receiver");
eventChannel.setStreamHandler(this);