yasirkula / UnityNativeShare

A Unity plugin to natively share files (images, videos, documents, etc.) and/or plain text on Android & iOS
MIT License
908 stars 134 forks source link

Build error: duplicate com.yasirkula.unity.NativeCameraContentProvider #55

Closed hansg60 closed 4 years ago

hansg60 commented 4 years ago

Hello, I have both NativeCamera and NativeGallery in my project. I am getting a build error when building for android.

I have updated the NativeCamera and NativeGallery to the latest versions.

Thank you for your help.

Here is my AndroidManifest.xml

`<?xml version="1.0" encoding="UTF-8"?>

` Here is the error message: `CommandInvokationFailure: Gradle build failed. /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/Hub/Editor/2019.3.0b7/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-5.1.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease" stderr[ /Users/hans/WingBoat/AllowanceBotUnity/AllowanceBotUnity/Temp/gradleOut/launcher/src/main/AndroidManifest.xml:65:13-60 Error: Attribute provider#com.yasirkula.unity.NativeCameraContentProvider@authorities value=(com.wingboat.AllowanceBot) from [:unityLibrary] AndroidManifest.xml:65:13-60 is also present at [:NativeCamera:] AndroidManifest.xml:6:5-71 value=(com.wingboat.AllowanceBot.NativeCameraContentProvider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:63:9-67:50 to override. FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':launcher:processReleaseManifest'. > Manifest merger failed : Attribute provider#com.yasirkula.unity.NativeCameraContentProvider@authorities value=(com.wingboat.AllowanceBot) from [:unityLibrary] AndroidManifest.xml:65:13-60 is also present at [:NativeCamera:] AndroidManifest.xml:6:5-71 value=(com.wingboat.AllowanceBot.NativeCameraContentProvider). Suggestion: add 'tools:replace="android:authorities"' to element at AndroidManifest.xml:63:9-67:50 to override. * 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`
yasirkula commented 4 years ago

NativeCamera automatically adds the provider to the AndroidManifest (since v1.1), so you should remove the provider you have in your AndroidManifest.xml.

hansg60 commented 4 years ago

The one in there is the one added by NativeCamera. I tried removing it, but your code added it back in.

On Fri, Nov 22, 2019 at 9:18 AM Süleyman Yasir KULA < notifications@github.com> wrote:

NativeCamera automatically adds the provider to the AndroidManifest, so you should remove the provider you have in your AndroidManifest.xml.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnityNativeShare/issues/55?email_source=notifications&email_token=AAO6C5GYZGCMK4I6YRXNCSTQVAH6TA5CNFSM4JQKOB32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE6JEZA#issuecomment-557617764, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6C5HNEE3GHGFAIQPEYALQVAH6TANCNFSM4JQKOB3Q .

yasirkula commented 4 years ago

Does the string "com.wingboat.AllowanceBot.NativeCameraContentProvider" appear anywhere in your project? You can use CTRL+Shift+F to search the Entire Solution on Visual Studio.

hansg60 commented 4 years ago

Hello,

No, that string does not appear, but I found another manifest file in a temp directory that was causing the problem.

Thanks for your help, Hans

On Nov 22, 2019, at 11:46 AM, Süleyman Yasir KULA notifications@github.com wrote:

Does the string "com.wingboat.AllowanceBot.NativeCameraContentProvider" appear anywhere in your project? You can use CTRL+Shift+F to search the Entire Solution on Visual Studio.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yasirkula/UnityNativeShare/issues/55?email_source=notifications&email_token=AAO6C5BLOUUHCT7Y33BCIYLQVAZLBA5CNFSM4JQKOB32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE6VUXQ#issuecomment-557668958, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAO6C5ERL5O33IG7PFUUL7LQVAZLBANCNFSM4JQKOB3Q.