eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
217 stars 183 forks source link

Android folder of firebase_core_web-1.0.2 does not exist #144

Closed ShejaEddy closed 3 years ago

ShejaEddy commented 3 years ago

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'c:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_mapbox_navigation-0.0.26\android\build.gradle' line: 31

* What went wrong:
A problem occurred evaluating project ':flutter_mapbox_navigation'.
> Basedir c:\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core_web-1.0.2\android does not exist

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* Where:
Script 'c:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 346

* What went wrong:
A problem occurred configuring project ':flutter_mapbox_navigation'.
> Could not get unknown property 'android' for project ':flutter_mapbox_navigation' of type org.gradle.api.Project.

* 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 8s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                         9.8s
Exception: Gradle task assembleDebug failed with exit code 1```

I'm having a hardtime even building once. Please help!!!
eopeter commented 3 years ago

Do a flutter pub get. Also make sure gradle is up to date

On Sep 19, 2021, at 3:05 PM, Sheja Eddy @.***> wrote:

mapbox_navigation-0.0.26\android\build.gradle' line: 31 * What went wrong: A problem occurred evaluating project ':flutter_mapbox_navigation'. > Basedir c:\flutter.pub-cache\hosted\pub.dartlang.org\firebase_core

ShejaEddy commented 3 years ago

I made flutter clean && flutter pub get && flutter run still gives that error. Isn't it because of these configuration in build.gradle I first removed flutter_pabox_navigation package because Gradle wouldn't run because of that missing android folder. I added this gradle version distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

I will let you know of any update if it works after the installation, Thanks for your fast replies Sir.

ShejaEddy commented 3 years ago

I updated Gradle but still the problem persists. I'm not using mac book. I'm running on windows, the android folder is still missing in the firebase core used by flutter_mapbox_navigation. I'm really stuck now, any more help would be highly appreciated.

ShejaEddy commented 3 years ago

Even After running on mac, I'm still getting the same response. I don't know why It is looking for a missing android folder here in https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_core/firebase_core_web

ShejaEddy commented 3 years ago

At last it finally built.

I changed this in /android/settings.gradle

include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
}

To This code:

include ':app'

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"

Thanks for all the help @eopeter . Such a great work with this.