-
-
Notifications
You must be signed in to change notification settings - Fork 665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android dependency 'androidx.core:core' has different version for the compile (1.0.0) and runtime (1.0.1) classpath #228
Comments
for me , i added the android migration to the gradle properties file and then changed classpath 'com.android.tools.build:gradle:3.2.1' to classpath 'com.android.tools.build:gradle:3.3.1'. im using geolocator 3.0.1. follow this link https://www.youtube.com/watch?v=ZRl4t2KdEHQ and then do what i have said above |
I
when i added the (android.useAndroidX=true |
Thanks @aidooyaw1992 , changing the classpath to 3.3.1 worked for me too :) |
I had these set and the same issue was happening. Thanks, @aidooyaw1992! |
My pleasure
…On Mon, 18 Mar 2019, 17:17 Matheus Henrique de Oliveira, < ***@***.***> wrote:
I
for me , i added the android migration to the gradle properties file and
then changed classpath 'com.android.tools.build:gradle:3.2.1' to classpath
'com.android.tools.build:gradle:3.3.1'. im using geolocator 3.0.1. follow
this link https://www.youtube.com/watch?v=ZRl4t2KdEHQ and then do what i
have said above
when i added the (android.useAndroidX=true
android.enableJetifier=true)
to the gradle properties it worked thanks
I had these set and the same issue was happening.
What solved for me was the tip from @aidooyaw1992
<https://github.com/aidooyaw1992>, changing the classpath to gradle:3.3.1.
Thanks, @aidooyaw1992 <https://github.com/aidooyaw1992>!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#228 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIG4X9VG3JH5L3NctGCqQ0NzTDuWl3XGks5vX8obgaJpZM4brXKj>
.
|
ref: Lyokone/flutterlocation#117 Looks similar. |
I there mates... Facing the same issue did solved it by changing the classpath from 3.2.1 to gradle:3.3.0 (not 3.3.1); and also did add the (android.useAndroidX=true Not sure wich one made it happend... Thaks a lot, futter team... |
Guys, that would be very nice if you could tell us in which files you made the changes. I did a search for
Edit: Now it works. Isn't dangerous to randomly change properties ? Will it still be compatible with older Android version ? |
@Robouste, the problem is that we have upgraded the Geolocator plugin to support AndroidX (as well as still be compatible with older Android versions). This means you will also have to upgrade you App which can be done following these instructions: |
try to add script in app level subprojects { |
if (details.requested.group == 'androidx.core' |
Its working fine by adding android.enableJetifier=true and android.useAndroidX=true in build project and change the classpath to 3.3.1 |
Following solved my issue (2)Add following to root gradle subprojects { |
|
Thanks aidooyaw1992 that worked for me. dependencies: and then override and it works for dependencies on intl ^0.16.0 |
🐛 Bug Report
Hi everybody,
Can't install this plugin, tried different versions this plugin (3.0.1, 3.0.0, 2.1.1, 2.1.0), but not one did not work. Has anyone encountered this problem already?
pubsec.yaml
name: flutter_app
description: A new Flutter application.
version: 1.1.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
geolocator: ^3.0.1
permission_handler: ^3.0.0
meta: ^1.1.6
google_api_availability: ^2.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.6.1
flutter_icons:
image_path: "assets/img/location.png"
android: true
flutter:
uses-material-design: true
assets:
- assets/img/location.png
- assets/img/gps.png
- assets/img/no_gps.png
- assets/img/where.jpg
LocationPage.dart
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
class LocationPage extends StatefulWidget {
@OverRide
LocationPageState createState() => LocationPageState();
}
class LocationPageState extends State{
initLocation()async{
Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
print(position);
}
initState() {
super.initState();
initLocation();
}
@OverRide
Widget build(BuildContext context) {
return Scaffold(...);
}
}
CONSOLE OUTPUT:
Running "flutter packages get" in flutter_app... 0.6s
Launching lib/main.dart on MI 6 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Execution failed for task ':app:preDebugBuild'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
Finished with error: Gradle task assembleDebug failed with exit code 1
Reproduction steps
flutter run -d
Configuration
Version: 3.0.1
Platform:
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.13.6 17G65, locale en-UA)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.31.1)
[✓] Connected device (1 available)
• No issues found!
The text was updated successfully, but these errors were encountered: