Flutter Mapbox构建不断失败(清单合并失败)

时间:2018-06-20 12:33:04

标签: android android-studio flutter mapbox mapbox-gl

我正在尝试使用Flutter构建我的第一个应用程序,并希望使用Mapbox GLmapbox_gl: ^0.0.1)来实现一些Maps。

我得到的错误是在构建应用程序期间。更确切地说,它在gradlew assembleDebug处失败。输出如下:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.4.0) from [com.android.support:appcompat-v7:25.4.0] AndroidManifest.xml:28:13-35
    is also present at [com.android.support:support-v4:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
    Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
Finished with error: Gradle build failed: 1

如上所述,我已对build.gradleAndroidManifest.xml添加了所需的更改 here。我还添加了'tools:replace="android:value"'建议,但仍然出现相同的错误。

flutter doctor输出:

[✓] Flutter (Channel beta, v0.4.4, on Linux, locale en_NL.UTF-8)
    • Flutter version 0.4.4 at /path/flutter
    • Framework revision f9bb4289e9 (6 weeks ago), 2018-05-11 21:44:54 -0700
    • Engine revision 06afdfe54e
    • Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /path/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 27.0.3
    • Java binary at: /path/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.1)
    • Android Studio at /path/android-studio
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (1 available)
    • Moto G 5 • android-arm • Android 7.0 (API 24)

• No issues found!

当我在pubspec.yml中删除Mapbox依赖项时,构建成功。删除构建文件夹/运行flutter clean没有任何结果。

还有其他人遇到过吗?我在这里看不到我在做什么错,因此非常感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

如果您想学习代码并查看工作示例,那么我建议您克隆此github存储库https://github.com/georific/flutter-mapbox-gl/tree/accessToken而不是https://github.com/mapbox/flutter-mapbox-gl,并按照自述文件中的说明进行操作。

希望有帮助。

干杯