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

Plugin not working after publishing #171

Closed
sajadj313 opened this issue Feb 19, 2020 · 1 comment
Closed

Plugin not working after publishing #171

sajadj313 opened this issue Feb 19, 2020 · 1 comment

Comments

@sajadj313
Copy link

Hi all,

I can create events on debug mode and it works very well but once the apk is published, the plugin does not work as expected.

Steps to reproduce:

  • In the build mode, execute the code to create a basic event
  • flutter clean
  • flutter build apk
  • install the apk on a real mobile device
  • execute the same event creation code

`void _createEvent() async {
final calendar = DeviceCalendarPlugin();

if (!(await calendar.hasPermissions()).data) {
  var result = await calendar.requestPermissions();
  if (!result.data) {
    return;
  }
}

var availableCalendars = await calendar.retrieveCalendars();

if (availableCalendars.data.isEmpty) {
  return;
}

var defaultCalendarId = availableCalendars.data.first.id;

final event = Event(defaultCalendarId,
    title: 'Sajad has created an event',
    allDay: false,
    start: DateTime.now(),
    end: DateTime.now().add(Duration(days: 2)));

event.reminders = [];

event.reminders.add(Reminder(minutes: 10));

var addedEvent = await calendar.createOrUpdateEvent(event);

if (addedEvent.isSuccess) {
  key.currentState.showSnackBar(SnackBar(content: Text('Success')));
} else {
  key.currentState.showSnackBar(
      SnackBar(content: Text(addedEvent.errorMessages.first)));
}

}`

This is the error that I get:
[400] To create or update an event you must provide calendar ID, event with a title and event's start date and end date (where start date must be before end date)

my flutter doctor results:
`
[√] Flutter (Channel stable, v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.18362.657], locale en-US)
• Flutter version 1.12.13+hotfix.7 at C:\src\flutter
• Framework revision 9f5ff2306b (3 weeks ago), 2020-01-26 22:38:26 -0800
• Engine revision a67792536c
• Dart version 2.7.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\Lenovo\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[!] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.42.1)
• VS Code at C:\Users\Lenovo\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1

[!] Connected device
! No devices available

! Doctor found issues in 3 categories.
`

Any idea?
Thanks

@bhl09
Copy link
Contributor

bhl09 commented Feb 21, 2020

Add a line to a Proguard config from here or if you're just testing it, you can try building by flutter build apk --no-shrink

@bhl09 bhl09 closed this as completed Feb 21, 2020
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

2 participants