Flutter Bluetooth Serial Android embedded - android

I'm working with flutter and I'm getting this error while I was trying to add lutter_bluetooth_serial to the pubspec.yaml. This is the error that I get.-->"The plugin flutter_bluetooth_serial 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: https://flutter.dev/go/android-plugin-migration." ---->I don't know how to solve this issue Can you help??? I also changed to buildgradle->defaultConfig{
minSdkVersion 19 };

flutter_blue, the author of package should update the package,to match the flutter version.
https://pub.dev/packages/flutter_blue
There is nothing you can do. Either use an other package or ask the package developer to fix the problem.
you can try
https://pub.dev/packages/flutter_blue
do your stuff, this package has function like flutter_blue.

Related

After compile my flutter project "The plugins `flutter_absolute_path, flutter_string_encryption` use a deprecated version of the Android embedding."

The plugins flutter_absolute_path, flutter_string_encryption use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them 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: https://flutter.dev/go/android-plugin-migration.

Which library should I use for Location when using google maps?

I have the following library for the google maps and it works fine
implementation 'com.google.android.gms:play-services-maps:16.1.0'
But when I try to add this one for location,
implementation 'com.google.android.gms:play-services-location:16.1.0'
the following error occurs
Failed to resolve: com.google.android.gms:play-services-location:16.1.0
Which library for the location should I use?
THANK YOU.
You will get latest gradle dependencies here
https://developers.google.com/android/guides/setup
It is probably because 16.1.0 does not exist for this library. Google Play Services libraries do not always have the same version. So maps might be on 16.1.0 but location might not even have this version.
To get the latest versions, check the official release page: https://developers.google.com/android/guides/releases
And as you are just starting, make sure to use the latest ones:
com.google.android.gms:play-services-location:17.0.0
com.google.android.gms:play-services-maps:17.0.0
Yes, it is a coincident that those versions are currently the same. As you can see in the list there are already libraries on 19.0.0, like appindexing
com.google.firebase:firebase-appindexing:19.0.0
Edit
A small practical tip: If you replace the version by + and sync the project, gradle will get the newest one and afterwards you can use the IDE warning to replace the + again with the newest version number. That eases a bit the checking on different pages if there is a new version or not etc

Plugin.Geolocator not Available

I have a strange behavior.
I'm creating an xamarin.forms solution using the Montemagno Geolocator plugin. https://github.com/jamesmontemagno/GeolocatorPlugin. In debug mode everything is fine.
I have this API configuration:
"Compiled Used Android Version: API27",
"Minimun Android to Target: API21".
If I put "Target Android version: API27" the plugin geolocator always returns me error 'not Available'.
If I put "Target Android version: Use Compile using SDK version" everything is ok but Google Play Store does not accept it because from August 1st it wants at least API26.
where is the error?
UPDATE************
I read the interesting article of montemagno https://blog.xamarin.com/android-apps-google-play-target-api-level-requirements/
So I updated vs2017 to the latest release, I have updated all the nuget packages included: Xamarin.Forms.GoogleMaps, Plugin.CurrentActivity, Xam.Plugin.Geolocator, Xam.Plugin.Media.
Montemagno say "These must be set to a specific version and cannot be set to “Use Compile Version”, but, in my smartphones, the locator only works if I use the setting “Use Compile Version”. If I use montemagno settings, I get locator.IsGeolocationAvailable = false!!
it work if i use android:targetSdkVersion="25"...
I solved by introducing a few lines of code to manage the permissions using the plugin 'Plugin.Permissions'. The fact remains that, until a few weeks ago everything worked smoothly without the aforementioned plugin.
For the code, see the example in the plugin https://github.com/jamesmontemagno/GeolocatorPlugin

Default or static interface method used without --min-sdk-version >= 24

Why do we get this error in Android Studio 3.0 RC1?
com.android.dx.cf.code.SimException:
default or static interface method used without --min-sdk-version >= 24
According to the android docs, the feature "Default and static interface methods" is compatible with Any min-sdk version.
I tracked this down to a java-library that calls Comparator.naturalOrder() - which has been added in API level 24.
So I would not expect any error-message at all for this code in a java-library.
When I use the code in my own android-app or lib java code, I see the correct lint message: "Call requires API level 24)"
Is the error-message wrong or am I missing something?
I just found out that it works as expected when I activate the D8 dexer which is planned to be the default for Android Studio 3.1
In the project gradle.properties, add:
android.enableD8=true
Now the code compiles as expected and I still get the expected linter messages.
If the java-library that you're talking about was guava, you can try to upgrade it to the latest android-specific build
implementation 'com.google.guava:guava:23.0-android'
This fixed for me
From guava v24 we have two alternative versions: Android or JRE. So, in this case you need to include the dependency as:
compile 'com.google.guava:guava:24.1-android'
Find all the details within the repo: https://github.com/google/guava
If this error occurs due to Guava, then the solution, as per the official documentation from Google is:
https://github.com/google/guava
Change the dependency to (version is current as of this writing):
api 'com.google.guava:guava:27.0-android'
This fixed the issue for me.

different version number gradle file

My compiledsdkversion is 23. My Android support library has a 24.0.0-alpha1designation at the end of the string which declares it on my gradle app file. Gradle is compiling with errors stating that the support library should not use a different version than the compiledsdkversion.Any ideas on how to get rid of this error. I don't know how to update the compiledsdkversion.
You should use the latest stable version of the Support Library, which is currently 23.2.1 as per the release notes.

Categories

Resources