The plugin flutter_inappwebview requires Android SDK version 33 - flutter

I am using flutter_inappwebview and youtube_player_flutter also in my flutter app.
flutter_inappwebview - 5.4.3+7 and youtube_player_flutter - 8.1.1.
While run the app I am getting like "The plugin flutter_inappwebview requires Android SDK version 33". But after changing the version, Then also its now workin.
I tried changing the version also. It's not working.

I think that try to change the android\app\build.gradle file's:android { compileSdkVersion 33 } and also check that the minSdkVersion, I am not sure about this.

Related

Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)

Suddenly this error appears in the debug console. I do not know what I did wrong.
You've upgraded Flutter but not the packages. In the terminal enter
flutter pub outdated
Then upgrade the outdated packages one by one like this:
flutter pub upgrade outdated_package
After you're finished:
flutter clean
and
flutter pub get
Your problem should now be solved.
I had the same issue and stumped on this post.
In my case I was able to detect which plugin was in fact giving the error and it turned out to be firebase_core. So, I decided to upgrade the package to the latest version which happened to be 1.21.1 in my case.
So, to solve the issue I will suggest you try changing the version of the firebase_core package you're using to the latest in the pubspec.yaml file of your project like so:
firebase_core: ^1.21.1 (replace with latest verison)
Or you can just run:
flutter pub upgrade firebase_core
This will upgrade firebase_core to the latest version.
Or you can as well put any as the version code in the pubspec.yaml file of your project like so:
firebase_core: any (upgrades firebase_core to the latest verison)
Please also check the compileSdkVersion in android/app/build.gradle and update it to 33
You are good to go with these three steps,
Flutter clean
Flutter pub get
Flutter run
If you are using these dependecies then replace it with a latest version:
firebase_messaging
firebase_core
flutter_local_notifications
Then in android/app/build.gradle update compileSdkVersion flutter.compileSdkVersion to 33
I spent a long time looking into this and eventually traced it to the plugin registrar being nil when setting up the plugin.
This was caused by setting my iOS app root view controller to anything other than FlutterViewController (i.e. in my case, I had a UINavigationController as the root). This will result in a failure to register all your plugins.
The app delegate assumes that the root view controller is a FlutterViewController, so if it isn't then you will need to re-direct all plugin-related function calls to your FlutterViewController from your app delegate by overriding these functions as follows:
override func registrar(forPlugin pluginKey: String) -> FlutterPluginRegistrar? {
flutterViewController.registrar(forPlugin: pluginKey)
}
override func hasPlugin(_ pluginKey: String) -> Bool {
flutterViewController.hasPlugin(pluginKey)
}
override func valuePublished(byPlugin pluginKey: String) -> NSObject? {
flutterViewController.valuePublished(byPlugin: pluginKey)
}
I was have this problem.
after downgrade awesome_notifications package to 0.6.21, resolved this.
I also effected from that issue for few hours, finally I found issue that was I ran my emulator as windows (:, yeah please run with Android emulator you selected vm.
for me my dependencies were up to date but I was using windows as an emulator so I switched to android emulator issue was resolved.

Executoin faild for task ':app:processDebugResources'

I am using Android Studio as SDK Platforms and SDK Tools. Currently, I have a problem when running the android emulator using Visual Studio. I have checked flutter doctor and no issues has been found. However, it shows an error as below.
As i run flutter run --verbose to search for the problems, it shows more details of the error as below
Just for sharing. Since I installed android studio, visual studio and flutter in my device using windows 11 pro, it doesn't work. However, I solved this problem by downgrading the Windows version into Windows 10 Home and it solved this particular problem. Anyone who face the same issue might try this in your current device.
This look like gradle compatibility issue.
Step to solve.
create new flutter project. try to compile the prject, if it work fine.
compare the android folder with yours and replace what is missing with the new flutter project you created.
sync your project after.
file/invalidateCache
flutter clean
flutter pub get
flutter run
you should be fine
To solve your error you have to update your compileSDKversion to the newest version which is currently 31.
You can find the compileSDKversion inside android > app > build.gradle
android {
compileSdkVersion 31
...
}
Note: you have to close and open android studio again

The plugin admob_flutter uses a deprecated version of the Android embedding

when i put admob_flutter: ^2.0.0-nullsafety.1 in pubspec, and type on cmd flutter pub get this error occurs!
The plugin admob_flutter uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of
Flutter will remove these deprecated APIs.
It's for latest flutter updates. so you can't do anything. Please use other package or wait till fix the problem by package developer because this error is produced after flutter version 2.5.
I have downgraded my flutter version by command flutter downgrade and it shows an option of a downgraded flutter version and it resolves my error.
Downgrading flutter worked for me.

MissingPluginException(No implementation found in flutter using geolocator

i am using geolocator in flutter project to get current location but this error come on it.
i added all dependencies in both ios and android files still get this error i dont know why
flutter channel stable, 2.12,
here is my code:
Position position = await Geolocato.getCurrentPosition( desiredAccuracy: LocationAccuracy.high);
here is my error coming which i tested android 10, 8 also, but answer same
Unhandled Exception: MissingPluginException(No implementation found for method getCurrentPosition on channel flutter.baseflow.com/geolocator)
i am using geolocator plugin here is plugin link :https://pub.dev/packages/geolocator
Maybe someone will need my solution. This happens because GeolocatorPlatform.instance is not initialized. Call _registerPlatformInstance() where you need.
import 'package:geolocator_android/geolocator_android.dart';
import 'package:geolocator_apple/geolocator_apple.dart';
void _registerPlatformInstance() {
if (Platform.isAndroid) {
GeolocatorAndroid.registerWith();
} else if (Platform.isIOS) {
GeolocatorApple.registerWith();
}
}
Running flutter clean and flutter pub get fixed the issue for me. I uninstalled the application, cleared the cache of my device and rebuilt the app. This time there was a popup asking to give location permission to the app.
I gave the access and got the current position of the device (latitude and longitude).
Also make sure you upgrade flutter to 3.0.0 by running flutter upgrade
If you just installed the package (geolocator), just restart the app or even better the phone.
Stop running the app completely and restart the app.
make sure that the app is killed before restart
click stop button, refer below,
Upgrade your flutter
Run on terminal flutter upgrade
or flutter upgrade —-force
Then =>flutter pub outdated
Then =>flutter pub upgrade
After that =>flutter pub upgrade —-major-versions
Finally go to
yourProjectName/android/app/build.gradle
Change:
android {
compileSdkVersion ##
…
…
}
To:
android {
compileSdkVersion 33
…
…
}

shared preference macos lib missing from Dart

I have this error with my Flutter app that caused by Dart SDK
I use Flutter 1.22.6 with Dart SDK 2.10.5 (stable) & intellij 2020.3 ...
when click on fix only remove shows, after remove the error goes, but then the error starts popup ...as I'm doing Android app so it's not affecting , but later for the iOS version I guess it will affect .
any idea how to solve ?
It looks like a cache problem.
Try to run the following commands:
flutter pub cache repair
flutter packages get