MissingPluginException(No implementation found for method requestPermissions on channel flutter - android

I have the problem with flutter 2.0 and androidX project, with iOS work fine. I already check all the documentation and issues but no lucky.
I'm working with those libraries in pub spec.yaml:
image_picker: 0.7.5+3
permission_handler: ^8.0.0+2
the line with the exception:
await Permission.photos.request();
relevant configs:
gradle propieties
android.useAndroidX=true
android.enableJetifier=true
manifest xml
android:requestLegacyExternalStorage="true
GeneratedPluginRegistrant.java:
the plugins are present
I already run flutter clean, flutter run, cold run, but again, no lucky.
any ideas are welcome, regards

Try in terminal,
flutter clean
flutter run
Stop running the app and kill the app from device/simulator. Then restart the application.
Stop running by clicking button, refer screenshot below,

Related

Flutter: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create' [duplicate]

When I try to run my Flutter project, I get errors like:
../../../.pub-cache/hosted/pub.dev/file-6.1.2/lib/src/interface/file.dart:15:16: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create'. Future create({bool recursive = false});
Running flutter clean and flutter upgrade didn't help. What's wrong? How do I fix this?
I kept getting the same error, But I solved it adding by adding
file: ^6.1.4 in my dependencies
If you are having the same problem. Make sure you have the latest file dependency.
I think the problem is caused by an outdated reference to file dependency. See this issue.
For fix this, on the project or library folder run:
dart pub upgrade
This command will upgrade your dependencies and the problem will be solved without adding the reference to latest version of file dependency.
I just ran in to this issue and I was on flutter's master channel. I switched back to stable (flutter channel stable) and everything works fine.
For me the packages in my pubspec.yaml were all up to date, but the following fixed it:
Delete pubspec.lock.
Run flutter pub get again.
i solved it by adding file: ^6.1.4 to my pubspec i dont know why this is needed in dependenccies but when i added it worked
this error occured to me when i was trying to update my flutter and packages
but error thrown was of transitive dependencies i guess when u defin in dependencies it over rides the transitive one
but it worked for me
but after wards once project ran i removed the file dependencie from my punspec did a flutter clean and a pub get again and ran the project again it worked without any problem

Getting `Could not find com.google.firebase:firebase-core:.` error in flutter add-to-app

I'm trying to integrate a Flutter app with the add-to-app feature following the Official documentation which is outdated as per this thread. In my Flutter part's pubspec.yaml, I have this Dependency Library - firebase_core: ^2.4.1
And in my Android Project's App level build.gradle file, I have this -
implementation(platform("com.google.firebase:firebase-bom:31.0.3"))
implementation("com.google.firebase:firebase-core")
I was using 31.2.0, but since I started getting this error, I switched to 31.0.3 since that's what Flutter's package was using.
When I run flutter build aar and Sync android project the with Gradle, I get these errors -
And when I just try to run the app, I see this -

issue with updating package dependencies

what does it even mean? I tried to update the package version due to some issue I faced.I thought it would solve the issue.But now I am stuck here.I don't understand why it says that it depends on the other package.
You can remove the version with any like image_cropper: any. Flutter will choose compatible version.
Then flutter pub get and then open the pubspec.lock and took the version number there.
Also you can try
image_picker: ^0.8.5+3

error -The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using

I am trying to build the android apk. I am facing the below error.
Tried with flutter clean, updated pub get, and I am using flutter 2.2.3
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Do these steps : 1. Try adding this line In your Project folder > android > app > build.gradle, add the following Line in
multiDexEnabled true
inside defaultConfig
2.Then upgrade gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (previously on version 3.2.1)
3.Run flutter clean and rebuild your project
Based on your other feedback, the basic troubleshooting is
(1) flutter doctor and
(2) to try to build the apk for the sample app. See https://docs.flutter.dev/get-started/test-drive?tab=terminal
If the build works with the sample app, then you know your environment is good but something is up with your app.
(3) if you think your gradle might be corrupted, you might copy your lib/ and pubspec.yaml to a blank project to start.
You mentioned a cloud_firestore issue. There are several things that need to be setup to get cluod_firestore working, including the google-services.json that are easy to mess up.
You might also have version incompatabilities with firebase. There are some breaking changes in the last couple of years.
I always try to run the sample/example code first to see if my tooling is correct. So, try that with flutter fire: https://firebase.flutter.dev/docs/overview

React Native Android error in com.facebook.react.bridge.NoSuchKeyException

I'm getting an error caught by Crashlytics and it's happening to almost 45% of the users but it doesn't seem to happen when the user is using the app but when it's in the background.
The stacktrace shown on Crashlytics is:
Fatal Exception: com.facebook.react.bridge.NoSuchKeyException ReadableNativeMap.java:124
lineNumber
I have no clue what can be causing this issue, if it's a Javascript error or a native library error
This is a problem caused by the stacktrace-parser library which is used internally by react native. Basically, release 0.1.4 works fine while releases 0.1.5 and 0.1.6 causes the lineNumber error.
Do the following to fix this:
If you are using yarn add the following to your package.json:
"resolutions": {
"stacktrace-parser": "0.1.4"
},
if you are using npm add the following to your package.json:
"dependencies": {
...
"stacktrace-parser": "0.1.4"
Remove the yarn.lock (or package-lock.json) file and the node_modules directory.
Install the packages yarn install (or npm install)
Rebuild your release build.
I hope this helps others until the library gets fixed.
My solution was to remove every console.error in my project.
https://github.com/facebook/react-native/issues/24382
Make sure "backgroundColor" value is never null or undefined. In my case that was the reason.
It ended up being an issue with some native library that was causing the crash. Simply upgrading it solved the problem

Categories

Resources