From fd63f30cb4c3bba2d4eb966a17e848277337150f Mon Sep 17 00:00:00 2001 From: sainw Date: Thu, 25 Jun 2020 15:03:12 +0630 Subject: [PATCH] fix android plugin --- android/app/build.gradle | 9 ++++ android/app/src/main/AndroidManifest.xml | 52 ++++++++++--------- .../com/mokkon/fcs_dev/fcs/Application.java | 20 +++++++ .../com/mokkon/fcs_dev/fcs/MainActivity.java | 9 +++- 4 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 android/app/src/main/java/com/mokkon/fcs_dev/fcs/Application.java diff --git a/android/app/build.gradle b/android/app/build.gradle index d406937..bf27151 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -52,3 +52,12 @@ android { flutter { source '../..' } + +dependencies { + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + implementation 'com.android.support:multidex:1.0.3' + implementation 'com.google.firebase:firebase-auth:19.0.0' + implementation 'com.google.firebase:firebase-messaging:20.1.0' +} \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0257c6f..e26cdfa 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,47 +1,51 @@ + + + + + + android:icon="@mipmap/ic_launcher" + android:usesCleartextTraffic="true"> - + - - + android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" + android:value="true" /> + + + + - - + + + diff --git a/android/app/src/main/java/com/mokkon/fcs_dev/fcs/Application.java b/android/app/src/main/java/com/mokkon/fcs_dev/fcs/Application.java new file mode 100644 index 0000000..1fe18f1 --- /dev/null +++ b/android/app/src/main/java/com/mokkon/fcs_dev/fcs/Application.java @@ -0,0 +1,20 @@ +package com.mokkon.fcs_dev.fcs; + + import io.flutter.app.FlutterApplication; + import io.flutter.plugin.common.PluginRegistry; + import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback; + import io.flutter.plugins.GeneratedPluginRegistrant; + import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService; + + public class Application extends FlutterApplication implements PluginRegistrantCallback { + @Override + public void onCreate() { + super.onCreate(); + FlutterFirebaseMessagingService.setPluginRegistrant(this); + } + + @Override + public void registerWith(PluginRegistry registry) { + GeneratedPluginRegistrant.registerWith(registry); + } + } diff --git a/android/app/src/main/java/com/mokkon/fcs_dev/fcs/MainActivity.java b/android/app/src/main/java/com/mokkon/fcs_dev/fcs/MainActivity.java index a47a5aa..4a8f859 100644 --- a/android/app/src/main/java/com/mokkon/fcs_dev/fcs/MainActivity.java +++ b/android/app/src/main/java/com/mokkon/fcs_dev/fcs/MainActivity.java @@ -1,6 +1,13 @@ package com.mokkon.fcs_dev.fcs; -import io.flutter.embedding.android.FlutterActivity; +import android.os.Bundle; +import io.flutter.app.FlutterActivity; +import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + GeneratedPluginRegistrant.registerWith(this); + } }