yasirkula / UnityNativeShare

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

"Can't find ContentProvider, share not possible!" with no provider tag in XML #60

Closed wdelvi closed 4 years ago

wdelvi commented 4 years ago

Heyo!

I am using NativeShare in Unity 2019.1.14f1 on Android 8.1.0 and am getting the following error message:

Can't find ContentProvider, share not possible!

I found this post by you that told me to open an issue. I also followed a couple of sources, and attempted to insert a Provider Tag into my Android Manifest. This didn't work, though I may be doing something wrong.

Any help appreciated!

Log Printout:

02-04 22:56:13.086   335  4659 D DlbDap2Process: process() called [734500] times
02-04 22:56:14.568  1849  1865 D SystemGestures: pointer 0 down pointerIndex=0 trackingIndex=0
02-04 22:56:14.568  1849  1865 D SystemGestures: pointer 0 down x=757.4532 y=663.8563
02-04 22:56:14.569  1849  1865 D WindowManager: onScreenTouch()663.8563
02-04 22:56:14.694 32490 32517 E Unity   : Can't find ContentProvider, share not possible!
02-04 22:56:14.946  1849  1864 D CompatibilityInfo: mCompatibilityFlags - 4
02-04 22:56:14.946  1849  1864 D CompatibilityInfo: applicationDensity - 160
02-04 22:56:14.946  1849  1864 D CompatibilityInfo: applicationScale - 1.0
02-04 22:56:14.952  1849  1877 D CompatibilityInfo: mCompatibilityFlags - 4
02-04 22:56:14.952  1849  1877 D CompatibilityInfo: applicationDensity - 160
02-04 22:56:14.952  1849  1877 D CompatibilityInfo: applicationScale - 1.0

Android Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="mam.mewandme.mewandme" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
    </activity>
    <provider android:name="mam.mewandme.mewandme" android:authorities="MewAndMe" android:exported="false" android:grantUriPermissions="true" />
  </application>
</manifest>
yasirkula commented 4 years ago

Latest version of the plugin should add the provider automatically. If it doesn't, then you mustn't change the "android:name" value of the provider in AndroidManifest, change only "android:authorities".

wdelvi commented 4 years ago

Worked like a charm! Thank you!