问题
I'm trying to run this HERE maps example for Flutter:
https://github.com/etzuk/flutter_here_maps
. I've followed the README instructions:
Android gradle.
Import HERE-sdk.aar as aar module. (AndroidStudio) File -> New -> New Module -> Import .jar/.aar module. Add your keys to manifest and service as described at HereMaps guide Change the intent-filter in HereMaps Service to app package name.
I'm trying to run the example and it still gives me this:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve project :HERE-sdk.
Required by:
project :app > project :flutter_here_maps
> Unable to find a matching configuration of project :HERE-sdk: None of the consumable configurations have attributes.
* 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.
I added HERE-sdk.aar
file to a libs folder in the Android app directory. the imported the file with the File -> New -> New Module -> Import .jar/.aar module
option and in Project Structure
I added the module but I can't see it. If I try again, it says `Project already contains subproject with name HERE-sdk', but it's not visible in the list.
I also added the following to the app level build.gradle file, as I did in an Android project that worked:
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
}
dependencies {
implementation(name: 'HERE-sdk', ext: 'aar')
...
}
回答1:
I updated the repository. Now you only need to copy the HERE-sdk.aar to example/android/HERE-sdk/, and it should work.
Please remember to put the application keys in the correct place, as described in the readme.
We are using this project in release versions, and it works great.
来源:https://stackoverflow.com/questions/60319195/flutter-says-it-could-not-resolve-project