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
Related
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.
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
This line is automatically generated by Gradle. I want to avoid using +, so I need the most recent stable version of Crashlytics.
compile "com.crashlytics.android:crashlytics:1.+"
get the latest version from maven metadata:
https://maven.fabric.io/public/com/crashlytics/sdk/android/crashlytics/maven-metadata.xml
.. same with the fabric plugin:
https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml
Go to ~/.gradle/caches/modules-2/files-2.1, and look for com.crashlytics.android/crashlytics. In there you will find folders with cached versions of the dependency, which are named with the full version number.
My latest cached version is 1.1.13, but it might be outdated already. Note that the gradle plugin has a different version number.
Before version 2.3.0, we can find the latest release from https://maven.fabric.io, we can get the xml output of all the release version without download to local.
$ curl -L https://maven.fabric.io |tidy -xml -i - |grep "crashlytics\-.*pom<"
After version 2.3.0, no xml output anymore when accessing the url above.
Or we should change the way to get xml output?
But we can get latest version from its docs, assuming crashlytics documents are updated, it's version 2.6.5 when writing this post.
The pom file did exists https://fabric-artifacts.s3.amazonaws.com/public/com/crashlytics/sdk/android/crashlytics/2.6.5/crashlytics-2.6.5.pom
The most recent Crashlytics version (for Android) is listed here:
https://fabric.io/kits/android/crashlytics/install
Also, make sure to keep the Gradle plugin up to date by checking this link for the latest version: https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
I'm new to Android Studio and i want to implement Urban Airship in one of my projects. I followed the example on their website with the .aar file and I ended up getting this error.
Error: [/Users/AndroidstudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.urbanairship/urbanairship-lib/5.1.0/AndroidManifest.xml:8]
Invalid instruction 'overrideLibrary', valid instructions are : REMOVE,REPLACE,STRICT
Correct me if I'm wrong but doesn't this mean that they have issues in their manifest file? Or am I completely out in the blue? If so, do anyone have a good example on how to implement it?
The Urban Airship SDK builds against Google Play Services that requires Android API 9, while Urban Airship is compatible with 6+. That is why we need the override library version. What android gradle plugin version are you using? You need to use 13.3 or greater. See http://tools.android.com/tech-docs/new-build-system.
In the projects build.gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.+'
}
}
I just had the same problem, and was able to fix it and build my project:
The offending line is line 8 of the AndroidManifest.xml
I just removed this line and changed some SDK versions.
You can open the file urbanairship-lib-5.1.0.aar using WinRar.
Navigate to the Manifest. Open it and edit within your favourite text editor.
Save and close the manifest. WinRar asks if you want to update the archive. Choose Yes!
According to this page, overrideLibrary is used for when you have minSDK version in a library > minSDK version in your project. So it allows a different version to be compiled instead, without errors.
http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger#TOC-tools:overrideLibrary-marker
Remove, replace etc do something a bit different (also described on that page - scroll up).
Then in my projects build.gradle file I changed the version numbers to match my project:
From this
compile 'com.android.support:support-v4:21.+'
To this
compile 'com.android.support:support-v4:19.+'
Would be good to know what's the outcome of the OP's support ticket. Please keep us posted!
I ran into this issue as well evaluating the 5.1.0 version of the Urban Airship SDK. I am using Android Studio Beta 0.8.14. I contacted Urban Airship support and they told me to increment the version of gradle to 0.13.3. Android Studio 0.8.14 is defaulting to 0.13.2. After changing the version of gradle to 0.13.3 in the project build.gradle file I was able to successfully compile and import the new SDK.
Gradle project sync failed.
After update the android SDK I got this error:
Error:Failed to find: com.google.android.gms:play-services:5.2.8
I have checked that the sdk location which is updated is used by Android Studio
I've got Google Repository installed and Android Support Repository too all up to date.
Also I have a ANDROID_HOME local variable pointing to the sdk I'm actually using
try using com.google.android.gms:play-services:5.2.08 instead of 5.2.8.
you can also look for the right version number in your services directory:
.. /android-studio/sdk/extras/google/m2repository/com/google/android/gms/play-services/
Check your sdk extras packages, you need to install:
Google Play services
Google Repository
For me, the thing was that I didn't have the second one installed and then "---:5+" worked
as described here:
https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start
You can now use
compile 'com.google.android.gms:play-services:6.1.11'
I use
compile 'com.google.android.gms:play-services:6.1.+'
Even though it warns against it. If things go flakey after an update I'll revert back to the current version.
I had the same problem. I solved using:
compile 'com.google.android.gms:play-services:7.0.0'
Suggesting using Open File> Project Structure, click the "add (+)",
searching for "play-service" to select the currently available version.
Something like this image:
http://i.stack.imgur.com/9Pv7j.jpg