Skip to content
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

Build failure for fresh project #40

Closed
vaishnavmhetre opened this issue Jan 18, 2021 · 14 comments · Fixed by #41
Closed

Build failure for fresh project #40

vaishnavmhetre opened this issue Jan 18, 2021 · 14 comments · Fixed by #41

Comments

@vaishnavmhetre
Copy link

Howdy mate! Love your awesome wrapper for open-source map implementation.

The build failed with following stacktrace. No idea of the fix! It is a fresh project created for flutter with latest version (both flutter and your plugin).

Launching lib\main.dart on Mi Max 2 in debug mode...
lib\main.dart:1

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\mhetr\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\flutter_osm_plugin-0.4.7+3\android\build.gradle' line: 47

* What went wrong:
A problem occurred evaluating project ':flutter_osm_plugin'.
> Could not find method buildFeatures() for arguments [build_8hixj53buk134vkzq4463b2ue$_run_closure2$_closure9@1de153b1] on object of type com.android.build.gradle.LibraryExtension.

* 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

@vaishnavmhetre
Copy link
Author

vaishnavmhetre commented Jan 18, 2021

Found a stackoverflow fix for the issue!! Maybe if it helps...

https://stackoverflow.com/a/64643474

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

did you update gradle version to 4.1.1 of your app

@vaishnavmhetre
Copy link
Author

vaishnavmhetre commented Jan 18, 2021

Could you please suggest the process? I'm using vscode and tried opening the project in Android studio, but didn't get a pop-up!!

Will changing classpath 'com.android.tools.build:gradle:3.5.0' to classpath 'com.android.tools.build:gradle:4.4.1 work in android/build.gradle?

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

OK, so you need to make several steps
1-remove flutter_osm_plugin from pubspec, after that pub get
2- open android module in android studio ( right click in name of project -> flutter-> open android module in android studio)
3- update gradle version to 4.1.1 ( IDE will show popup to make update)
4- update kotlin version to 1.4.21 & re-build the project
5- re-add flutter_osm_plugin in pubspec , pub get ( or flutter clean & pub get )

@vaishnavmhetre
Copy link
Author

Yeah, tried opening, but never got update popup for gradle!!

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

ok change it manually
in build.gradle(project) change 3.5.0 to 4.1.1
in gradle/wrapper/gradle-wrapper.properties change distributionURL to this
https://services.gradle.org/distributions/gradle-6.5-bin.zip
and sync gradle

@vaishnavmhetre
Copy link
Author

Okay, manual changes worked. Kotlin version upgrade required right?

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

yeah update it to 1.4.21

@vaishnavmhetre
Copy link
Author

Okay. in progress. I would really suggest you to put these things in Installations docs. reason being that the default flutter app comes with low versioned packages by default, so almost every user faces this!

@vaishnavmhetre
Copy link
Author

vaishnavmhetre commented Jan 18, 2021

Got this error after updating both while Gradle Sync

This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer.

Checked plugin updates, and IDE updates, no updates available.

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

what'sversion of android studio that you currently used !

@vaishnavmhetre
Copy link
Author

Android Studio 4.0.2
Build #AI-193.6911.18.40.6821437, built on September 9, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1246M
Cores: 4
Registry: ide.new.welcome.screen.force=true, ide.balloon.shadow.size=0
Non-Bundled Plugins: Dart, org.jetbrains.kotlin, com.chrisrm.idea.MaterialThemeUI, com.cjamcu.getx-snippets, com.google.services.firebase, io.flutter

@vaishnavmhetre
Copy link
Author

Although I Run the app as is. and it built successfully.

@liodali
Copy link
Owner

liodali commented Jan 18, 2021

you need AS 4.1.1
great, i will add those instruction in readme

@liodali liodali linked a pull request Jan 18, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants