incrediblezayed / file_saver

A simple flutter plugin for saving files in all platforms
https://pub.dev/packages/file_saver
BSD 3-Clause "New" or "Revised" License
75 stars 101 forks source link

Type mismatch: inferred type is BinaryMessenger? but BinaryMessenger was expected in the line C:\AndroidStudio\flutter\.pub-cache\hosted\pub.dartlang.org\file_saver-0.1.0\android\src\main\kotlin\com\one\file_saver\FileSaverPlugin.kt line(30,31) #40

Closed nilotpalkapri closed 2 years ago

nilotpalkapri commented 2 years ago

It is causing build failure I found the error in the specified file Error Line: methodChannel = MethodChannel(messenger, "file_saver")

My Solution: messenger?.let{ methodChannel = MethodChannel(messenger, "file_saver") methodChannel?.setMethodCallHandler(this) }

matthewwong525 commented 2 years ago

I started seeing this as well when i upgraded to Flutter 3

Chandio763 commented 2 years ago

Facing same issue, please upgrade the package to flutter 3

mrdyman commented 2 years ago

it's come when upgraded flutter to version 3. still waiting to update the package :)

yahu1031 commented 2 years ago

You can actually solve this temporarily

dependency_overrides:
  file_saver:
    git:
      url: https://github.com/incrediblezayed/file_saver.git
      ref: main
kzawadi commented 2 years ago

hahaha, @yahu1031 I found you here man... tirelessly debuging why my at_app on flutter 3 is not compiling ...

yahu1031 commented 2 years ago

You might have asked me then 🤣

kzawadi commented 2 years ago

Man ... they say a good programmers look for issues before filling one.. definitely you will be my one-stop shop

ollyde commented 2 years ago

@incrediblezayed can we get a patch for this?

incrediblezayed commented 2 years ago

I'm so sorry for the delay, I'll fix everything thsi sunday

PedroMoreira87 commented 2 years ago

image I tried this solution and it worked

ollyde commented 2 years ago

@PedroMoreira87 it's a bit tricky to this on build servers which do refresh builds each time. Why we need a patch.

yahu1031 commented 2 years ago

https://github.com/incrediblezayed/file_saver/issues/40#issuecomment-1148810119 this is current patch you can use for build @ollydixon @PedroMoreira87

ollyde commented 2 years ago

@yahu1031 I see that but it's not safe to use "main" commits for building production apps.

yahu1031 commented 2 years ago

@ollydixon Yes, But the main branch always doesn't go with unstable code. This branch generally referred to production. When they fix things, The stable code goes here. So, No worries to use it. Incase you still feel it may break, Then pick up the working reference hash/commit id and refer it in pubspec instead of main. So it will only take the code you referred to.

incrediblezayed commented 2 years ago

Fixes are coming to pub.dev tonight or tomorrow