Streaming assets vs absolute path type Unity sense image target iOS

0 votes
asked May 12, 2021 by lmcapazita (190 points)
Hello and thanks in advance:

I have this problem when playing an iOS project:

Setting path type to Absolute for the image target ---> works when playing on the editor / doesn't work when deploting the actual app to the store.

Setting path type to StreamingAssets for the image target ---> doesn't work when playing on the editor / dont know if will work on the store as I haven't tried given that it doesnt seem to work already.

What path type should I use?

Thanks.

2 Answers

+1 vote
answered May 12, 2021 by kenn (18,790 points)
Let's assume that you are familiar with Unity and absolute file path (in an operating system concept) first.

Path "a/b/c" with type StreamingAssets is equal to Path.Combine(Application.streamingAssetsPath, "a/b/c") with type Absolute.

A general hint is, a absolute file path like "c:/some/file.ext" or "/Users/some/file.ext" do not work across systems (Windows/Mac form the editor and Android/iOS from the phone).

Choose what you want and set correct value.
0 votes
answered May 13, 2021 by lmcapazita (190 points)
Hello, thanks for your reply kenn. This is my case:

In Unity, when playing the app (iOS platform) if the target is placed at Assets / StreamingAssets it wont recognize it. But it will work in the app when tested via TestFlight

Same scenario but placing the target at Assets it will recognize it when hitting play but it wont in TestFlight.

At least I managed to publish the app correctly but it hasn't been that easy working with easyAr.
commented May 23, 2021 by kenn (18,790 points)
Can you access files using file paths (not Unity assets) without EasyAR, like read a file's content from Unity when you place files where you want?
If yes, then use the same file path and set type to absolute.
And do not provide unusual data to EasyAR, like an encrypted file or file path.

Anyway, reading a file from EasyAR has no difference from reading a file using a normal non-Unity C# method.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...