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

Conflicts in AndroidManifest.xml #621

Closed
qiuqimin opened this issue Dec 12, 2019 · 1 comment
Closed

Conflicts in AndroidManifest.xml #621

qiuqimin opened this issue Dec 12, 2019 · 1 comment

Comments

@qiuqimin
Copy link

qiuqimin commented Dec 12, 2019

What I did

  1. Add plugin
  2. Run failed
  3. According to
C:\Users\Qiu\Desktop\cp103_dart_lib_and_app\example\smart_keeper_mobile\android\app\src\debug\AndroidManifest.xml:12:13-72 Error:
	Attribute provider#androidx.core.content.FileProvider@authorities value=(com.zorvee.smart_keeper_mobile.fileProvider.install) from [:install_plugin] AndroidManifest.xml:12:13-72
	is also present at [:flutter_webview_plugin] AndroidManifest.xml:11:13-64 value=(com.zorvee.smart_keeper_mobile.fileprovider).
	Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:10:9-18:20 to override.
C:\Users\Qiu\Desktop\cp103_dart_lib_and_app\example\smart_keeper_mobile\android\app\src\debug\AndroidManifest.xml:17:17-63 Error:
	Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_install_paths) from [:install_plugin] AndroidManifest.xml:17:17-63
	is also present at [:flutter_webview_plugin] AndroidManifest.xml:17:17-50 value=(@xml/filepaths).
	Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.

I edited the AndroidManifest.xml like this:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.zorvee.smart_keeper_mobile"
    xmlns:tools="http://schemas.android.com/tools">
<provider
            android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
            android:authorities="${applicationId}.flutter_downloader.provider"
            tools:replace="android:authorities"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"
                tools:replace="android:resource"/>
        </provider>
  1. It didn't work.

System info

Issue occurs on: Android
Plugin version: 0.3.10

Logs

[   +1 ms] C:\Users\Qiu\Desktop\cp103_dart_lib_and_app\example\smart_keeper_mobile\android\app\src\debug\AndroidManifest.xml:12:13-72 Error:
[   +2 ms]      Attribute provider#androidx.core.content.FileProvider@authorities value=(com.zorvee.smart_keeper_mobile.fileProvider.install) from [:install_plugin] AndroidManifest.xml:12:13-72
[  +41 ms]      is also present at [:flutter_webview_plugin] AndroidManifest.xml:11:13-64 value=(com.zorvee.smart_keeper_mobile.fileprovider).
[   +2 ms]      Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:10:9-18:20 to override.
[   +1 ms] C:\Users\Qiu\Desktop\cp103_dart_lib_and_app\example\smart_keeper_mobile\android\app\src\debug\AndroidManifest.xml:17:17-63 Error:
[        ]      Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_install_paths) from [:install_plugin] AndroidManifest.xml:17:17-63
[   +1 ms]      is also present at [:flutter_webview_plugin] AndroidManifest.xml:17:17-50 value=(@xml/filepaths).
[        ]      Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
[ +370 ms] Running Gradle task 'assembleDebug'... (completed in 20.1s)
[   +1 ms] *******************************************************************************************
[   +2 ms] The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
[        ] See https://goo.gl/CP92wY for more information on the problem and how to fix it.
[        ] *******************************************************************************************
[   +3 ms] "flutter run" took 27,122ms.
Gradle task assembleDebug failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:751:5)
#2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#3      _rootRunUnary (dart:async/zone.dart:1132:38)
#4      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:522:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#11     runCommandAndStreamOutput (package:flutter_tools/src/base/process.dart)
#12     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#13     _rootRunUnary (dart:async/zone.dart:1132:38)
#14     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#15     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#16     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#17     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#18     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#19     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#20     _rootRun (dart:async/zone.dart:1124:13)
#21     _CustomZone.run (dart:async/zone.dart:1021:19)
#22     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#24     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#26     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#27     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

flutter doctor -v

[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.535], locale zh-CN)
    • Flutter version 1.9.1+hotfix.6 at C:\flutter
    • Framework revision 68587a0916 (3 months ago), 2019-09-13 19:46:58 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Qiu\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • ANDROID_SDK_ROOT = C:\Users\Qiu\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] IntelliJ IDEA Ultimate Edition (version 2019.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4
    • Flutter plugin version 41.1.4
    • Dart plugin version 192.7761

[!] VS Code (version 1.40.2)
    • VS Code at C:\Users\Qiu\AppData\Local\Programs\Microsoft VS Code
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 1 category.
@qiuqimin
Copy link
Author

I resolved this problem by adding these code in AndroidManifest.xml:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileProvider"
    android:exported="false"
    android:grantUriPermissions="true"
    tools:replace="android:authorities">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/filepaths"
        tools:replace="android:resource" />
</provider>

LinuCC added a commit to LinuCC/flutter_webview_plugin that referenced this issue Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant