- Home /
Android Share Creates Invalid Photo,Invalid Image on Android Share
Hi Everyone, hoping someone out there can help me. I've been stuck on this a few days now.
I'm using the plugin Ultimate Mobile Pro from Stan's Assets which is overall pretty great, but I'm trying to implement sharing on Android platforms. We've got a working build for IOS where share and save are both working as intended, but on android some of our devices work and some don't.
When I try to perform a share of a Texture2D (generated at runtime) on a device it fails with, I get a variety of errors depending on the app I choose to share it to. Invalid format, can't send empty message, can't find file, things of that nature. After attempting to share, I see an empty file is added to the device's gallery:
This file is size 0 bytes and is supposedly located at "/Internal storage/Pictures" but I can't ever locate it via "My Files" or browsing while connected to a PC. After several seconds, the correct image appears in the gallery, but by this time the "Share" action has failed.
I've contacted support for the plugin, but thought I would reach out to the community as well to see if I've missed anything, or if anyone can point me in the right direction. Some things I've considered:
I've dug into the plugin and although the code has many layers, at the core it appears to be doing things correctly, adding the image via intent as best I could tell (i'm not really an Android expert).
I've tried builds with "Write Permission" set to Internal and External and both have the same behavior.
The Texture2D is read/write enabled since it's generated at runtime.
The test devices might indicate newer versions of Android are what causes the problem, the 2 devices it works on are using Android 5 and 9, whereas the ones that use 10 and 11 are the ones that don't work. This isn't really conclusive though.
I am hoping I am just missing a Manifest line or project setting or something but I can't for the life of me figure out what it could be. Any and all help is greatly appreciated! Thank you.
,Hi Everyone, hoping someone out there can help me. I've been stuck on this a few days now.
I'm using the plugin Ultimate Mobile Pro from Stan's Assets which is overall pretty great, but I'm trying to implement sharing on Android platforms. We've got a working build for IOS where share and save are both working as intended, but on android some of our devices work and some don't.
When I try to perform a share of a Texture2D (generated at runtime) on a device it fails with, I get a variety of errors depending on the app I choose to share it to. Invalid format, can't send empty message, can't find file, things of that nature. After attempting to share, I see an empty file is added to the device's gallery:
This file is size 0 bytes and is supposedly located at "/Internal storage/Pictures" but I can't ever locate it via "My Files" or browsing while connected to a PC.
After several seconds, the correct image appears in the gallery, but by this time the "Share" action has failed:
I've contacted support for the plugin, but thought I would reach out to the community as well to see if I've missed anything, or if anyone can point me in the right direction. Some things I've considered:
I've dug into the plugin and although the code has many layers, at the core it appears to be doing things correctly, adding the image via intent as best I could tell (i'm not really an Android expert).
I've tried builds with "Write Permission" set to Internal and External and both have the same behavior.
The Texture2D is read/write enabled since it's generated at runtime.
The test devices might indicate newer versions of Android are what causes the problem, the 2 devices it works on are using Android 5 and 9, whereas the ones that use 10 and 11 are the ones that don't work. This isn't really conclusive though.
I am hoping I am just missing a Manifest line or project setting or something but I can't for the life of me figure out what it could be. Any and all help is greatly appreciated! Thank you.
Your answer
![](https://koobas.hobune.stream/wayback/20220613032909im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
i can't export 0 Answers
script does not update inspector? 3 Answers
Connect Andorid Phone and get error 1 Answer
Easy way of using Android's natives gallery / sound library? 0 Answers