Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle build failing after I include package (different version for the compile (26.1.0) and runtime (27.1.0) classpath) #100

Closed
zeexan-dev opened this issue Sep 13, 2018 · 10 comments

Comments

@zeexan-dev
Copy link

zeexan-dev commented Sep 13, 2018

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

##Following is from gradle file

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"
    }
....
@zeexan-dev zeexan-dev changed the title Gradle build failing after I include package Gradle build failing after I include package (different version for the compile (26.1.0) and runtime (27.1.0) classpath) Sep 13, 2018
@MaikuB
Copy link
Owner

MaikuB commented Sep 13, 2018

Please read the readme

@zeexan-dev
Copy link
Author

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);
  }

@MaikuB
Copy link
Owner

MaikuB commented Sep 14, 2018

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

@zeexan-dev
Copy link
Author

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

@MarkEggensteinNet
Copy link

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.** { *; }

@zeexan-dev
Copy link
Author

Thanks @MarkEggensteinNet , working fine now

@MaikuB
Copy link
Owner

MaikuB commented Sep 15, 2018

Closing now that's it's resolved. Thanks for your help @MarkEggensteinNet

@MaikuB MaikuB closed this as completed Sep 15, 2018
@saadismail
Copy link

@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.

@MaikuB
Copy link
Owner

MaikuB commented Sep 17, 2018

@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

@OmarQataberi
Copy link

OmarQataberi commented Oct 4, 2018

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.... (package:Thikra/notifications.dart:204)
E/flutter (18232): #5 State.setState (package:flutter/src/widgets/framework.dart:1125)
E/flutter (18232): #6 _NotificationsState.build... (package:Thikra/notifications.dart:194)
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. (dart:async/future_impl.dart:516)
E/flutter (18232): #31 _microtaskLoop (dart:async/schedule_microtask.dart:41)
E/flutter (18232): #32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants