Giter Site home page Giter Site logo

Comments (3)

olokobayusuf avatar olokobayusuf commented on June 16, 2024

Hey @teleportal-andrew, can you try exporting the Unity project to a Gradle project instead of building an APK directly from Unity? If you inspect the generated Android manifest, that will show whether Unity might not be adding the <provider> tag to the final manifest.

however I haven't been able to track down the class name to provide for android:name

https://github.com/natsuite/NatShare/blob/36ab10097f6dbf7968cd517b5b1aee9b24cd4df1/Android/NatShare/src/main/java/api/natsuite/natshare/SharePayload.java#L103-L112

from natshare.

teleportal-andrew avatar teleportal-andrew commented on June 16, 2024

Here's what I see in the merged android manifest:

        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="my.app.uri.natshare"
            android:exported="false"
            android:grantUriPermissions="true" >
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>

Though it seems here androidx.core.content.FileProvider is used as the "class name" that I was trying to track down above

It may be worth noting that the share chooser is able to share the file - this error message is specifically related to being able to preview the file from the chooser

I spent some time trying different modifications - setting android:readPermissions on the provider, using grantUriPermission(...) from addMedia explicitly, adding FLAG_GRANT_READ_URI_PERMISSION to Intent chooser directly after Intent.createChooser(...) all without results

as far as I can tell from the documentation, provider in manifest file and chooser codebase look correct
Android Version is 11 build number RP1A.201005.004

my only (crude) guess at the moment is that file preview comes from a separate app bundle that also needs permissions granted

from natshare.

olokobayusuf avatar olokobayusuf commented on June 16, 2024

It may be worth noting that the share chooser is able to share the file - this error message is specifically related to being able to preview the file from the chooser

This is critical info then. Looks like the issue is that the preview image doesn't show up? If so, it's probably some quirk with Android. Issues like these are pretty difficult to debug, because there's poor documentation on how it is expected to behave.

my only (crude) guess at the moment is that file preview comes from a separate app bundle that also needs permissions granted

I believe this is internal to Android. I'm closing this issue.

from natshare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.