Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Sharing file get "couldn't attach file" in gmail #112

Open
dlungor opened this issue May 17, 2021 · 3 comments
Open

Sharing file get "couldn't attach file" in gmail #112

dlungor opened this issue May 17, 2021 · 3 comments
Labels

Comments

@dlungor
Copy link

dlungor commented May 17, 2021

Description of the bug

Gmail say's me "Couldn't attach file". Only on 11 android. I'm using it like this.

new NativeShare().AddFile(pathToAttachment).Share();

Reproduction steps

If possible, providing reproduction steps would be very helpful while pinpointing the issue. You can also post screenshots if you think they would be helpful.

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: e.g. 2019.4.23f1
  • Platform: Android
  • Device: Xiaomi Mi 10 Lite 5G, Android 11 RKQ1.200826.002
  • Package Manager. Is up-to-date

Additional info

Android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:usesCleartextTraffic="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
    <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>
    <activity android:name=".NativeShareCustomShareDialogActivity" android:theme="@style/Theme.NativeShareTransparent" />
    <!-- native toolkit -->
    <activity android:name="com.secondfury.nativetoolkit.MainActivity" android:configChanges="orientation|screenSize" />
    <activity android:name="com.secondfury.nativetoolkit.LocalNotificationResult" />
    <receiver android:name="com.secondfury.nativetoolkit.LocalNotification" />
    <!-- end native toolkit -->
    <activity android:name=".NativeShareCustomShareDialogActivity" android:theme="@style/Theme.NativeShareTransparent" />
    <provider
        android:name="com.yasirkula.unity.NativeShareContentProvider"
        android:authorities="SkyTrack_SkyTrack_Share"
        android:exported="false"
        android:grantUriPermissions="true"
        tools:replace="android:authorities"/>
  </application>

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
</manifest>
@dlungor dlungor added the bug label May 17, 2021
@yasirkula
Copy link
Owner

yasirkula commented May 17, 2021

I'm assuming that pathToAttachment resides in either persistentDataPath or temporaryCachePath, as it should. Do you get the same error on other Android 11 devices/emulators? Do other free solutions like this also suffer the same issue?

@dlungor
Copy link
Author

dlungor commented May 17, 2021

On another android 11 devices/emulators the same issue.

Path generated like this:

private static string GenerateNewFilePath(string extension)
    {
        return $"{Application.persistentDataPath}/{GenerateNewFileName(extension)}";
    }

Another solutions doesn't try yet

On android 10 all ok.

@yasirkula
Copy link
Owner

Please let me know when you try other free solutions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants