Following is the error that I get
Android dependency 'com.android.support:support-compat' has different version for the compile (26.1.0) and runtime (27.1.0) classpath. You should manually
set the same version via DependencyResolution
android {
compileSdkVersion 27
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "xxxxxxx"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
....
Please read the readme
working fine in debug mode. But when I build in release mode, as soon as the app opens, it crashes.
I have found that if i donot call following function in initstate() then open opens normally but if I call the following function, the doesnot open. I am able to figure out this issue.
Future _showDailyAtTime() async {
var time = new Time(17, 38, 00);
var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
'1',
'my channel name',
'my description of channel');
var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
var platformChannelSpecifics = new NotificationDetails(
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.showDailyAtTime(0, 'Daily Quotes',
'Find Your Motivation For Today', time, platformChannelSpecifics);
}
not something i've been able to reproduce in by calling that method during initState in the sample. I suggest you look at Logcat in Android Studio as I won't be able to investigate something that I can't reproduce. It's best to provide a full sample app where possible to investigate E.g. by forking the repo
I have found that if I set minifyEnabled to true, then this issue of app crash arrises as soon as code for scheduling notifications runs
I have found that if I set minifyEnabled to true, then this issue of app crash arrises as soon as code for scheduling notifications runs
Minifying also enables obfuscation, I think.
Try adding the following to your proguard rules:
-keep class com.dexterous.** { *; }
Thanks @MarkEggensteinNet , working fine now
Closing now that's it's resolved. Thanks for your help @MarkEggensteinNet
@MaikuB It would be really great to include this in Android Integration part. I spent a lot of time figuring it out the other day and I then disabled minification.
@saadismail can do though have you by any chance raised this as issue on the Flutter repo? Sounds like something they should add a note when an app consumes plugins as part of this documentation https://flutter.io/android-release/#step-2---enable-obfuscation-andor-minification
Didn't work for me, even after adding the progard rule,
But it works when I disable minification,
this error appear when i set the notification time from the app,
Logs:
E/flutter (18232): [ERROR:flutter/shell/common/shell.cc(182)] Dart Error: Unhandled exception:
E/flutter (18232): PlatformException(error, Missing type parameter., null)
E/flutter (18232): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551)
E/flutter (18232): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:279)
E/flutter (18232):
E/flutter (18232): #2 FlutterLocalNotificationsPlugin.showDailyAtTime (file:///E:/AndroidSDK/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-0.3.9/lib/src/flutter_local_notifications.dart:154)
E/flutter (18232):
E/flutter (18232): #3 _NotificationsState.showNightNotification (package:Thikra/notifications.dart:51)
E/flutter (18232):
E/flutter (18232): #4 _NotificationsState.build.
E/flutter (18232): #5 State.setState (package:flutter/src/widgets/framework.dart:1125)
E/flutter (18232): #6 _NotificationsState.build.
E/flutter (18232): #7 _RootZone.runUnary (dart:async/zone.dart:1379)
E/flutter (18232): #8 _FutureListener.handleValue (dart:async/future_impl.dart:129)
E/flutter (18232): #9 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642)
E/flutter (18232): #10 Future._propagateToListeners (dart:async/future_impl.dart:671)
E/flutter (18232): #11 Future._complete (dart:async/future_impl.dart:476)
E/flutter (18232): #12 _SyncCompleter.complete (dart:async/future_impl.dart:51)
E/flutter (18232): #13 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28)
E/flutter (18232): #14 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295)
E/flutter (18232): #15 _NotificationsState.changeDate (package:Thikra/notifications.dart:0)
E/flutter (18232): #16 _RootZone.runUnary (dart:async/zone.dart:1379)
E/flutter (18232): #17 _FutureListener.handleValue (dart:async/future_impl.dart:129)
E/flutter (18232): #18 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642)
E/flutter (18232): #19 Future._propagateToListeners (dart:async/future_impl.dart:671)
E/flutter (18232): #20 Future._complete (dart:async/future_impl.dart:476)
E/flutter (18232): #21 _SyncCompleter.complete (dart:async/future_impl.dart:51)
E/flutter (18232): #22 _AsyncAwaitCompleter.complete (dart:async/runtime/libasync_patch.dart:28)
E/flutter (18232): #23 _completeOnAsyncReturn (dart:async/runtime/libasync_patch.dart:295)
E/flutter (18232): #24 showTimePicker (package:flutter/src/material/time_picker.dart:0)
E/flutter (18232): #25 _RootZone.runUnary (dart:async/zone.dart:1379)
E/flutter (18232): #26 _FutureListener.handleValue (dart:async/future_impl.dart:129)
E/flutter (18232): #27 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642)
E/flutter (18232): #28 Future._propagateToListeners (dart:async/future_impl.dart:671)
E/flutter (18232): #29 Future._completeWithValue (dart:async/future_impl.dart:486)
E/flutter (18232): #30 Future._asyncComplete.
E/flutter (18232): #31 _microtaskLoop (dart:async/schedule_microtask.dart:41)
E/flutter (18232): #32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
Most helpful comment
Minifying also enables obfuscation, I think.
Try adding the following to your proguard rules:
-keep class com.dexterous.** { *; }