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

Cannot compile device_calendar on Android with last version 0.10.2 of flutter #67

Closed
zemanux opened this issue Nov 7, 2018 · 3 comments

Comments

@zemanux
Copy link

zemanux commented Nov 7, 2018

Hi,

I cannot run my program with Flutter v0.10.2. I get :

D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (82, 50): Type mismatch: inferred type is String? but String was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (92, 35): Type mismatch: inferred type is String? but String was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (96, 31): Type mismatch: inferred type is Long? but Long was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (97, 29): Type mismatch: inferred type is Long? but Long was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (99, 55): Type mismatch: inferred type is String? but String was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (105, 47): Type mismatch: inferred type is String? but String was expected
e: D:\dev\tools\flutter\.pub-cache\hosted\pub.dartlang.org\device_calendar-0.0.6\android\src\main\kotlin\com\builttoroam\devicecalendar\DeviceCalendarPlugin.kt: (105, 59): Type mismatch: inferred type is String? but String was expected
> flutter doctor -v
[√] Flutter (Channel beta, v0.10.2, on Microsoft Windows [version 10.0.16299.726], locale fr-FR)
    • Flutter version 0.10.2 at D:\dev\tools\flutter
    • Framework revision d8cbb80206 (12 days ago), 2018-10-26 01:30:21 -0400
    • Engine revision 6c2ade9fa2
    • Dart version 2.1.0-dev.8.0.flutter-bf26f760b1

[√] Android toolchain - develop for Android devices (Android SDK 28.0.2)
    • Android SDK at C:\Users\...\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
    • All Android licenses accepted.

[√] Android Studio (version 3.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 28.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[√] VS Code, 64-bit edition (version 1.28.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.20.0

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

Thanks for your help

@linuxeasy
Copy link

Exactly same issue here :(

@linuxeasy
Copy link

Figured it out. Following fixes the issue.

Replacing things in the said files in following way solves the issue:
for cases where error is:
Type mismatch: inferred type is String? but String was expected

Changing String references to ?:"", which just means if variable is null then return "" (blank)
From:
_calendarDelegate.retrieveEvents(calendarId, startDate, endDate, eventIds, result) //line (82,50)
To:
_calendarDelegate.retrieveEvents(calendarId?:"", startDate, endDate, eventIds, result) //line (82,50)

And for cases where error is:
Type mismatch: inferred type is Long? but Long was expected
Changing Long references to ?:0L, which just means if variable is null then return 0L (Zero of type Long)
from
event.start = eventStart //Line (96,31)
to
event.start = eventStart?:0L //Line (96,31)

@MaikuB
Copy link
Contributor

MaikuB commented Nov 16, 2018

PR #69 by @huzhiren should fix this issue and has been released in version 0.0.7. Closing this issue. Feel free to re-open if this is still an issue

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

3 participants