myfatoorah_flutter import package fails build - flutter

I have added myfatoorah_flutter package version 1.0.7 and in file I have imported the package as import 'package:myfatoorah_flutter/myfatoorah_flutter.dart'; it fails the build and gives the following error
../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/myfatoorah_flutter-1.0.7/lib/myfatoorah_flutter.dart:609:31: Error: The argument type 'bool Function(bool)' can't be assigned to the parameter type 'bool Function(bool, RouteInfo)'.
- 'RouteInfo' is from 'package:back_button_interceptor/src/back_button_interceptor.dart'
('../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-4.3.1/lib/src/back_button_interceptor.dart').
BackButtonInterceptor.add(myInterceptor);
I have tried following solutions and none of them worked:
changed version of myfatoorah_flutter
switched between channels dev/stable
upgraded flutter sdk
settings.gradle removed and added again
when I remove import line, it works fine, help is required so that I can integrate the payment methods

I am also getting the same error as I tried this way and worked for me.
change version of back_button_interceptor to back_button_interceptor: 4.0.2 in myfatoorah_flutter's pubspec.ymal.

Related

Upgrade to cordova-android 11: Plugin cordova-plugin-video-editor will not work anymore

I just updating my ionic project to Cordova Android 11 (because of android-targetSdkVersion which must be > 30 this fall).
Seems that good old plugin cordova-plugin-video-editor will not work anymore when building the project:
import net.ypresto.androidtranscoder.MediaTranscoder;
^
/Users/olivierschmid/AppDev/b2c-customer-app/platforms/android/app/src/main/java/org/apache/cordova/videoeditor/CustomAndroidFormatStrategy.java:6: error: package net.ypresto.androidtranscoder.format does not exist
import net.ypresto.androidtranscoder.format.MediaFormatStrategy;
^
/Users/olivierschmid/AppDev/b2c-customer-app/platforms/android/app/src/main/java/org/apache/cordova/videoeditor/CustomAndroidFormatStrategy.java:7: error: package net.ypresto.androidtranscoder.format does not exist
import net.ypresto.androidtranscoder.format.OutputFormatUnavailableException;
^
/Users/olivierschmid/AppDev/b2c-customer-app/platforms/android/app/src/main/java/org/apache/cordova/videoeditor/CustomAndroidFormatStrategy.java:14: error: cannot find symbol
public class CustomAndroidFormatStrategy implements MediaFormatStrategy {
Does someone have a tipp what alternative I can try (for compressing videos)? There seem not to be many options?
Thanks! Oli
Have you already tried adding "cordova-plugin-androidx-adapter"?

Flutter Redux Navigation library import error

I have been developing application and one of the libraries I have used was Flutter Redux Navigation. Everything was working fine, until recently, when I started getting following error
../../lib/src/navigation_middleware.dart:3:1: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
import 'package:flutter_redux_navigation/src/navigation_destination.dart';
^^^^^^^^^^^^^^^^^^^^^
../../lib/src/navigation_middleware.dart:35:26: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
this._setState(NavigationDestination(
^^^^^^^^^^^^^^^^^^^^^
../../lib/src/navigation_middleware.dart:55:26: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
this._setState(NavigationDestination(
I even tried to copy example project from their git, and got exactly same error. This is something in library, or perhaps some settings of my IDE? Please let me know if anyone encountered this error.
The problem was that I have upgraded Flutter version from 2.5.1 to 2.8.0. The newest Flutter version contains upgraded Material library, which contains the method called NavigationDestination. Thus both, the library and Material design have the same name of the class, of course, resulting in error.

Can't run Flutter web on Chrome Device with BluetoothThermalPrinter package

Can't run my flutter web app when blue_thermal_printer package is being used.
Compiler show these errors:
import 'package:blue_thermal_printer/';
^
/D:/All%20Data/Softwares/Latest%20Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/blue_thermal_printer-1.1.8/lib/blue_thermal_printer.dart:189:23:
Error: Type 'Registrar' not found.
static registerWith(Registrar value){
^^^^^^^^^
lib/generated_plugin_registrant.dart:31:3: Error: Getter not found: 'BlueThermalPrinterPlugin'.
BlueThermalPrinterPlugin.registerWith(registrar);
What I have tried until now:
1- Tried to enable flutter web support with this command: flutter create .
2- Tried to create a new class BlueThermalPrinterPlugin in the package file blue_thermal_printer.dart with the following method:
class BlueThermalPrinterPlugin{
static var nameoo ;
static registerWith(Registrar value){
this.nameoo=value;
return nameoo;
}
}
But that doesn't either helps because sdk generated automatic generated_plugin_registrant.dart which produces incomplete import i.e import 'package:blue_thermal_printer/'; causing compile time issue.
I need to run my flutter app on web which was working fine a few days before.
Thanks to the developer of this package whom I contacted personally and he corrected the error in packge. blue_thermal_printer 1.2.0 is working fine and doesn't contain this error anymore.

i upgraded ios version to11.4, when I build my project I am getting this error as AWSCore file not found'AWSCore/AWSCore.h' file not found.Pleasehelp

I upgraded ios version to 11.4, now when I build my project I am getting this error as AWSCore file not found'AWSCore/AWSCore.h' file not found
import and
failed to emit precompiled header
Please help how to resolve it
For me the issue was in the AWSFMDB+AWSHelpers.h file.
It has this import #import <AWSCore/AWSCore.h> which is weird since it's the package importing itself.
I manually deleted this line and rebuilt the project and it worked.
AWSFMDB+AWSHelpers

Why the app produced by flutter build web sometimes doesn't work?

I have 2 issues that only appear when executing flutter build web.
Sometimes flutter build web fails complaining (wrongly) about types that were not compatible (see below).
Sometimes the build process finishes but then the web app doesn't work: doesn't display anything and there are no messages in the console.
The error I mention is something like this:
% flutter build web
Target dart2js failed: Exception: lib/main.dart:24:31:
Error: A value of type 'ApiUsersRepository' can't be assigned to a variable of type 'UsersRepository'.
- 'ApiUsersRepository' is from 'package:my_app/api_users_repo.dart' ('lib/api_users_repo.dart').
- 'UsersRepository' is from 'lib/users_repo.dart'.
final UsersRepository usersRepository = ApiUsersRepository();
^
Error: Compilation failed.
The app is working in iOS and web when developing.
The solution
I changed all imports of my files like:
import 'package:my_app/users_repo.dart';
To:
import 'users_repo.dart';
More Details
Investigating the error about types, I found this issue, where the important part is this comment: after changing every import to relative format it resolves my problem.
So I did that, and it solved the 2 issues, the compilation error, and the runtime error.
for me I had to remove a package that was corrupted. c:\src\flutter.pub-cache\hosted\pub.dartlang.org\localstorage-4.0.0+1 Apparently, a file had become corrupted by me invertly. I removed the package and did a flutter pub get then recompiled and it worked.