Comments (6)
Finally remembered to look at this. Seems that loading from a jar using WWW/UnityWebRequest is hopeless in Editor. So instead of that, I just decided to handle errors better with 12d6df3. Thanks for noticing this!
from betterstreamingassets.
Also apologies for the multiple edits! I hit enter without expecting it to actually post just a title! :)
from betterstreamingassets.
Just realised I could test using iOS/PC mode, and it works perfectly - it may be that I'm misusing the tool truth be told.
I appear to have worked out where it's falling over through the use of breakpoints and debug.logs, as I never get to see past the first debug.log in this get method. :) I believe it's stumbling at the new Uri for a reason or another.
My test here is to make a uri and see what I can do with it.
Understandably, it hits the else condition myURiTest.TryCreate if I make the UriKind Absolute, as all it has to work with is cwlcommissioner.apk - without any further details or formatting.
It'll log the first line, but trying to get the AbsoluteUri throws the error:
System.InvalidOperationException: This operation is not supported for a relative URI.
private string StreamingAssetsPath
{
get
{
#if UNITY_EDITOR
if (BetterStreamingAssets.Root == EditorApkPath)
{
Debug.Log("Making new uri");
Uri myUriTest;
if (Uri.TryCreate(EditorApkPath, UriKind.Relative, out myUriTest))
{
Debug.Log("Made myUriTest " + myUriTest); // We reach this one
Debug.Log("Here is its AbsoluteUri" + myUriTest.AbsoluteUri); //But fail on this
}
else
{
Debug.Log("Couldn't make a relativeOrAbsoluteUri from " + EditorApkPath);
}
return "jar:" + new Uri(EditorApkPath).AbsoluteUri + "!/assets";
}
#endif
return Application.streamingAssetsPath;
}
}
from betterstreamingassets.
As an aside, I commented out the testHarness call (and all the error catching) and made a really primitive version... and it works perfectly! :)
The code I edited:
if (BetterStreamingAssets.FileExists(path))
{
Debug.Log("YAY" + path + " exists!");
yield return null;
}
else
{
Debug.Log("Oh bother, we lost the file at " + path);
}
byte[] byties = BetterStreamingAssets.ReadAllBytes(path);
Debug.Log("Copying to " + Application.persistentDataPath);
File.WriteAllBytes(Application.persistentDataPath + "/arenasetup.txt", byties);
//yield return coroutineHost.StartCoroutine(ErrorCatchingCoroutine(TestHarness(readMode, path, testType, attempts,
// (duration, bytes, memory, maxMemory, names) =>
// {
// testInfo.duration = duration;
// testInfo.bytesRead = bytes;
// testInfo.memoryPeak = memory;
// testInfo.maxMemoryPeak = maxMemory;
// }),
// ex =>
// {
// Debug.Log(ex);
// testInfo.error = ex;
// }
//));
results.Add(testInfo);
I am overjoyed at your solution to so many problems, and can't wait to make android builds after so much of my own time trying to come up with a solution! :) Thank you so much again, I can't overstate how much time and pain you've saved me and many other developers! :) I'll leave a glowing review on the asset store, and am happy to chip in with any extra info if I can help with this issue. :)
from betterstreamingassets.
Thanks for the report, I'll need some time to process this and then I will get back to you!
from betterstreamingassets.
That's great! :) Thank you again, BetterStreamingAssets was a godsend for this project :)
from betterstreamingassets.
Related Issues (20)
- Issues with GetFiles() throwing " DirectoryNotFoundException" on Android and stopping at the topmost folder HOT 2
- Special characters support HOT 1
- SubReadOnlyStream can Seek but cannot set Position HOT 3
- BetterStreamingAssets.DirectoryExists returns false HOT 1
- Does it works with WebGL? HOT 1
- Oh sir, Does it works with IOS? HOT 1
- How about make this plugin as a "Package" in "Package Manager"? HOT 9
- Question about file name lowercase HOT 3
- WebGL? HOT 5
- GetDirectories would be great HOT 1
- not worked on assetbundle with offset HOT 1
- exception when using Unity Patch functionality HOT 1
- [Android] Initialize failed with unauthorized access exception. HOT 3
- Access folder in streamingAssets folder in Android HOT 1
- Is it support obb/aab file HOT 1
- I cannot use this plugin on android. HOT 6
- The library doesn't work in Edit Mode HOT 1
- Play Asset Delivery use Asset Targeting by Country can't read asset in the master apk file. HOT 2
- Support for OpenHarmony HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betterstreamingassets.