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

result from retrieveCalendars() returns id and name = null on Android #217

Closed
chuckinSpace opened this issue Apr 3, 2020 · 12 comments
Closed
Assignees
Labels
more information required The issue requires more information before it can be actioned

Comments

@chuckinSpace
Copy link

chuckinSpace commented Apr 3, 2020

Only on Android (IOS is working fine, same code), I'm getting back a non-empty array with the right amount of calendars (length 2), but the actual fields are all null, (id, name etc..) any ideas? permissions are granted correctly, I tried both on the simulator and on a real device

final calendarsResult = await _deviceCalendarPlugin.retrieveCalendars();

Screen Shot 2020-04-03 at 9 45 00 AM

Screen Shot 2020-04-03 at 10 14 59 AM

@chuckinSpace chuckinSpace changed the title result from retrieveCalendars() gives e id and name = null on Android result from retrieveCalendars() returns id and name = null on Android Apr 3, 2020
@chuckinSpace
Copy link
Author

Well after starting from a brand new project I figured out what was wrong, I was running into this issue flutter/flutter#47517 after I added google sign in, and tried to fix it with one of the accepted answers ===>

buildTypes {
        release {
         signingConfig signingConfigs.debug
            minifyEnabled true
        }
        debug{
            minifyEnabled true
        }
    }

This created the conflict with device Calendar and start to get back null results, I fixed it using the other solution from the issue

Add this to defaultConfig

multiDexEnabled true

That one fixed the original issue and don't mess with device calendar

@bhl09
Copy link
Contributor

bhl09 commented Apr 6, 2020

We had similar issues previously on release mode, if related, you might want to check the Proguard settings for Android here.

@chuckinSpace
Copy link
Author

Yes, I am actually getting that issue now, waiting for some feedback on that there

@devs4522
Copy link

I am also facing same issue in release apk only even after applying above changes. Please help if anyone faced and resolved it before. Thanks

@devs4522
Copy link

I got it resolved by following Proguard settings. @Brett09 Could you please remove - if you have Proguard enabled, from the readme page because it is confusing . most of new developer dont know whether it is enabled for their project or not. So Make it a mandatory steps rather than optional in installation of this library.

@mcavazotti
Copy link

I'm getting the same issue. I'm new to app development and AFAIK I'm not using Proguard (I couldn't find any proguard file), and what @chuckinSpace suggested didn't work for me either....
Am I missing something?

@nickrandolph
Copy link
Contributor

@devs4522 can you suggest the changes to the readme that you'd like to see w.r.t. Proguard settings.
@mmc16 are you seeing this issue in both debug and release?

@nickrandolph nickrandolph added the more information required The issue requires more information before it can be actioned label Jun 6, 2020
@mcavazotti
Copy link

I solved this issue following this comment.

@PauloBrazilDHPP
Copy link

i have the same issue and tried all solutions listed here... nothing worked
when compiled directly on device, it works well... when i submmit to play console, when install the beta on any device doesnt work... any other idea?

@maerlynflagg
Copy link

i have the same issue and tried all solutions listed here... nothing worked
when compiled directly on device, it works well... when i submmit to play console, when install the beta on any device doesnt work... any other idea?

yeah same. Windows Android Emulator, all fine. debugging on real device fine. but a release build in Play Store is not working, cause missing or invalid calendar id.

@thomassth
Copy link
Contributor

@PauloBrazilDHPP and @maerlynflagg , can you confirm that you added the appropriate proguard settings?
https://github.com/builttoroam/device_calendar#proguard--r8-exceptions

@maerlynflagg
Copy link

@PauloBrazilDHPP and @maerlynflagg , can you confirm that you added the appropriate proguard settings?
https://github.com/builttoroam/device_calendar#proguard--r8-exceptions

yes i can confirm, that is fixed, after i made a proguard on 25 Mar.

this helped me:

#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }

#Plugins
-keep class com.builttoroam.devicecalendar.** { *; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more information required The issue requires more information before it can be actioned
Projects
None yet
Development

No branches or pull requests

9 participants