Registrar is deprecated. Deprecated in Java - android

I'm getting this warning: 'Registrar' is deprecated. Deprecated in Java' any time I run flutter build apk. This is the error dialogue in android studio:
:\Users\df\Desktop\flutter.pub-cache\hosted\pub.dartlang.org\app_settings-4.2.0\android\src\main\kotlin\com\example\appsettings\AppSettingsPlugin.kt:16:48: warning: 'Registrar' is deprecated. Deprecated in Java
import io.flutter.plugin.common.PluginRegistry.Registrar
^
I run flutter build apk and this error always pop up

The warning you're seeing is indicating that the class 'Registrar' is deprecated in the app_settings library you're using (version 4.2.0). This means that the class is no longer recommended for use and may be removed in a future version.
This class is part of the Flutter plugin system and is used to register plugins with the Flutter engine. In the latest versions of Flutter, the plugin registration process has been updated and the Registrar class is no longer needed.
To resolve this warning, you can try updating to a newer version of the app_settings library that does not use the deprecated Registrar class. You can check the latest version of the library on the pub.dev website.
Alternatively, you can try using a different library that provides similar functionality and is compatible with the latest version of Flutter.
It's also good to check that your app's dependencies are up-to-date and that you have the latest version of the Android Studio and all the necessary dependencies installed.
You can also try cleaning and rebuilding the project and running the app on different emulators or devices to see if the issue is specific to the device you are currently testing on.

Related

Unity crash on Android on startup: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/startup/R$string

We have a plugin for Unity to be used by games on Android. The plugin is built on macOS with gradle 7.1.1, multidex enabled, fat-aar, and grease 0.3.0
Building with Unity 2021.3.3f1 on macOS Monterey, deploying to device running Android 11.
Targeting Android SDK 32. Multidex is enabled, minify/jetifier/R8 all turned off in Unity's gradle build scripts. AndroidManifest.xml is set up properly to use multidex. I've checked spelling and class names, and since it's targeting SDK 32, we don't need to use the android.support package.
We're building a Unity project that only includes our plugin and some code that calls into it, so the project is already as barebones as it can get while still using the plugin. The Unity app was building and running just fine until we introduced fat-aar and grease. Also, Unity builds with a pretty old version of gradle, 4.6.
Our plugin also builds a test app APK, and that test app APK contains R$string.class as well as other R$* classes generated by multidex (found via dex2jar). Our plugin AAR contains R.txt that references androidx_startup.
It seems like a dependency isn't having it's string resources propagated forward to the final app, but I'm not even sure that's the problem.

Is there any alternative to flutter package call_log?

I've a flutter application which uses call_log flutter package to sync call logs between various devices. But currently I'm facing issues on latest android devices version 11. The error is:
The plugin call_log 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. If you are plugin author, take a look at the
docs for migrating the plugin to the V2 embedding
My app is crashing on latest android devices (version 11) and I'm not able to run on debug mode too.
What are the alternatives present? Shall I downgrade flutter version or wait for call_log package for new updates? My flutter version is 2.5.1. Call_log package version is 3.0.3. It was last updated in May month. call_log package
I'm just new in flutter so suggest me something I can do instantly to resolve this issue.

Gradle KTS Build Files

Google released an updated version of Android Studio 3.5. After having updated to this version I get this warning below:
This project uses Gradle KTS build files which are not fully supported.
Some functions may be affected.
However, I believe this warning is restricted to developers who are using the Gradle’s Kotlin DSL to manage their dependencies. Instead of using groovy scripts.
Now android studio 4.0 is officially Support for Kotlin DSL script files(*.kts) so you need to update it and see the warning removed from your Event Log.
you can check below image and read from it official Document

How do I determine compatible version for google services plugin, gradle plugin and dart pub packages

I'm learning flutter. The "Adding Firebase to Flutter" tutorial shows to use this; "com.google.gms:google-services:3.2.1" but the latest version seems to be 4.2.0
Also, I'd like to use suitable (latest?) version of packages from https://pub.dartlang.org/packages
Such as (currently):
firebase_core 0.3.1+1 and
google_sign_in 4.0.1+1
If I just choose the latest numbers I get a lot of compilation errors.
My Questions is: where can I find the latest supports/compatible version numbers for these various components?
The only thing I have found to work is to use:"com.google.gms:google-services:3.2.1" and to just keep downgrading pub package versions numbers until the compiler errors go away. I feel like there must be a more sane way to deduce the correct version numbers to use for various components.
Anybody have any insight into this issue?
Thanks
I need to see error messages but it's probably about AndroidX. If you have to check the changelog files of your plugins (by the way it's a good practice since sometimes readme's are not updated), you will probably see
Breaking change. Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.
google_sign_in 4.0.0 changelog
You can avoid AndroidX by using these packages listed or you can migrate to AndroidX with these instructions.
flutter create is not coming with androidx, it comes with android support libraries, but if you have Android Studio, it's easy to migrate it. In my case, I've migrated it.

Identifying culprits for numerous XA0106 warnings when building Xamarin.Forms app on Android

We have a Xamarin.Forms application which uses quite a few packages.
When building, we're getting hundreds of XA0106 warnings like this one:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Warning XA0106: Skipping Musterd.Droid.Resource.Attribute.MediaRouteControllerWindowBackground. Please check that your Nuget Package versions are compatible. (XA0106) (Musterd.Droid)
I know that this is because of mismatches between support libraries used by packages. The problem is finding out which one(s)!
Is there any tool or build setting I can use which will help me home on which packages are causing this and so which I can/should update?
This can happen when the version of the Android SDK you are using is different to the version of the Android support packages used by your app. The support packages are versioned in a way that should match the compile time Android SDK.
The best fix is to always use the latest of both.
Update your Android SDK to have the latest stable installed.
Make sure your app compiles against the latest version in the project settings.
In the Android project update all NuGet Packages that start with Xamarin.Android to the latest version.

Categories

Resources