mattermoran / map_launcher

Flutter plugin for launching maps
MIT License
263 stars 124 forks source link

Unable to start flutter app properly after pub get #60

Closed kimmanwky closed 2 years ago

kimmanwky commented 3 years ago

I got this error after pub get. Error: "Missing 'package' key attribute on element package at AndroidManifest.xml".

I have tried flutter clean, restart IDE, etc.. nothing helps..

[√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.746], locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[!] Android Studio (version 4.1.0)
    X Flutter plugin not installed; this adds Flutter specific functionality.   
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code (version 1.52.1)
[√] Connected device (1 available)

Error:

Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:4:9-64 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:4:9-64
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:5:9-68 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:5:9-68
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:6:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-56

C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:7:9-54 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:7:9-54
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:8:9-44 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:8:9-44

C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:9:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:9:9-56

C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:10:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:10:9-56
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:11:9-62 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:11:9-62
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:12:9-59 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-59
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:13:9-46 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:13:9-46
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:14:9-57 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:14:9-57
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml:15:9-51 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:15:9-51
C:\SDK\flutter\.pub-cache\hosted\pub.dartlang.org\map_launcher-1.1.3\android\src\main\AndroidManifest.xml Error:
    Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':map_launcher:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Manifest merger failed with multiple errors, see logs

* 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 10s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

AndroidManifest.xml file which related with the error.

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.alexmiller.map_launcher">

    <queries>
        <package android:name="com.google.android.apps.maps" />
        <package android:name="com.google.android.apps.mapslite" />
        <package android:name="com.autonavi.minimap" />
        <package android:name="com.baidu.BaiduMap" />
        <package android:name="com.waze" />
        <package android:name="ru.yandex.yandexnavi" />
        <package android:name="ru.yandex.yandexmaps" />
        <package android:name="com.citymapper.app.release" />
        <package android:name="com.mapswithme.maps.pro" />
        <package android:name="net.osmand" />
        <package android:name="ru.dublgis.dgismobile" />
        <package android:name="com.tencent.map" />
    </queries>

</manifest>
nambv commented 3 years ago

me too

/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:5:9-64 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:5:9-64
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:6:9-68 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:6:9-68
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:7:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:7:9-56
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:8:9-54 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:8:9-54
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:9:9-44 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:9:9-44
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:10:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:10:9-56
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:11:9-56 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:11:9-56
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:12:9-62 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:12:9-62
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:13:9-59 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:13:9-59
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:14:9-46 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:14:9-46
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:15:9-57 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:15:9-57
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml:16:9-51 Error:
    Missing 'package' key attribute on element package at AndroidManifest.xml:16:9-51
/Users/nambuivu/flutter/.pub-cache/hosted/pub.dartlang.org/map_launcher-1.1.3/android/src/main/AndroidManifest.xml Error:
    Validation failed, exiting

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':map_launcher:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Manifest merger failed with multiple errors, see logs
nambv commented 3 years ago

[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en)
    • Flutter version 1.22.5 at /Users/nambuivu/flutter
    • Framework revision 7891006299 (8 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/nambuivu/Library/Android/sdk
    • Platform android-30, build-tools 29.0.3
    • ANDROID_HOME = /Users/nambuivu/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.10.0

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin installed
    • Dart plugin version 201.9317
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6915495)

[!] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Live (mobile) • AHB00098571 • android-arm64 • Android 10 (API 29)```
mattermoran commented 3 years ago

Oh crap looks like fix for android 11 also requires gradle version adjustments in flutter project as well. For now can you bump your gradle version in android/build.gradle (not android/app/build.gradle) based on this table? image

For me it looks like this: image

kimmanwky commented 3 years ago

Looks fine for now. Lets me test out the rest and see how it goes.

nambv commented 3 years ago

worked after i update from 3.5.0 to 3.5.4

SolarMotion commented 3 years ago

Worked after adjustment on Gradle version. Thank you.

woelmer commented 3 years ago

Changing the gradle version to 3.5.4 solves this problem but creates another one. I also include google_maps plugin, and that fails on certain Android devices when you upgrade to 3.5.4.

mkhtradm01 commented 3 years ago

Oh crap looks like fix for android 11 also requires gradle version adjustments in flutter project as well. For now can you bump your gradle version in android/build.gradle (not android/app/build.gradle) based on this table? image

For me it looks like this: image

This works for me, thanks.

Aldo-f commented 3 years ago

The solution worked. But I'm not happy that this issue exist.

Should'n there be a better solution than manually updating gradle? Some backward compatible that you didn't look into?

(just weird that updating this package ment that I had to update gradle)

mattermoran commented 2 years ago

Well my bad for introducing a breaking change in a patch version (luckily it wasn't a runtime error) The information has been added to the changelog and to the readme a while ago. At this point, we going to have to live with it. Will try to make sure does not happen next time :)