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

Can't run App after Mapbox_gl set up due to Basedir not existing for location_web-3.1.1 #821

Closed
Dillondavis8 opened this issue Dec 16, 2021 · 5 comments
Labels

Comments

@Dillondavis8
Copy link

I currently have followed all of the flutter pub dev documentation for https://pub.dev/packages/mapbox_gl. I have both my public access token and secret token set. However, 'flutter run' keeps failing with this error:

Where:
Build file '/flutter/.pub-cache/git/flutter-mapbox-gl-4af59c508527a74914a7240251db0aa61ad4815a/android/build.gradle' line: 16

What went wrong:
A problem occurred evaluating project ':mapbox_gl'.
> Basedir /flutter/.pub-cache/hosted/pub.dartlang.org/location_web-3.1.1/android does not exist

What I currently have in 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
}

I have updated my Info.plist file and AndroidManifest.xml accordingly to pub dev and mapbox_gl documentation according to documentation.

The mapbox_gl documentation does not make it seem like I should be managing my settings.gradle/build.gradle files so I am unsure where else to look for what is causing the problem. I know that some people have suggested the workaround of creating an android folder: C:\dev\flutter.pub-cache\hosted\pub.dartlang.org\location_web-3.1.1\android as well in several path_provider directories, but this is not the production-level solution I am looking for.

@felix-ht
Copy link
Collaborator

the issue is fixed on master.

Check #789 for a working settings gradle

@Dillondavis8
Copy link
Author

the issue is fixed on master.

Check #789 for a working settings gradle

I have tried updating the settings gradle file before and it did not solve this issue. What is the specific version that is working?

@felix-ht
Copy link
Collaborator

changed it to this?

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"

@Dillondavis8
Copy link
Author

changed it to this?

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"

Yes I have tried changing the settings.gradle file to that. Your suggested solution does not work because it causes our application to trigger an error saying we have reached the 64k method limit. Do you know why this change may cause that error to arise?

@stale
Copy link

stale bot commented Mar 5, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 5, 2022
@stale stale bot closed this as completed Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants