Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by altra4u · May 02, 2013 at 11:41 PM · androidunity 4asset bundles

Problems with loading asset bundles on android

Hi guys

As the title says I'm trying to load asset bundles on android. I did put my asset bundles inside StreamingAssets and I do see my directories containing the asset bundles inside Assets folder in the apk. However when I try to do

Directory.GetFiles("jar:file://" + Application.dataPath + "!/assets/", "*.unity3d", SearchOption.AllDirectories);

I get a DirectoryNotFoundException: Directory 'jar:file:/data/app/com.Company.ProductName-2.apk!/assets' not found.

Not sure what I'm missing. Help appreciated.

Thanks

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image altra4u · May 02, 2013 at 11:48 PM 0
Share

Just to add its not like Directory.GetFiles doesn't work on anything. Cause if you do

Directory.GetFiles(Directory.GetCurrentDirectory()) it works just fine and prints all the results.

avatar image aeroson · Oct 23, 2015 at 01:12 PM 0
Share

The problem is " jar:file:/data/app/com.Company.ProductName-2.apk" is path to jar (zip) file. And "/assets" is path within this zip file.

jar: protocol seems to not be supported by Directory nor File classes. But Unity's WWW does support it only for files. So even with WWW you can not get directory info.

avatar image Bonfire-Boy · Jan 06, 2016 at 11:49 AM 0
Share

You can't treat the strea$$anonymous$$g assets folder like it's part of the filesystem (on Android).

Why are you trying to list all the .unity3d files that are in there? If it's just so that you can load them, why not just put the filenames into the code?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aeroson · Oct 24, 2015 at 03:37 PM

I think its fixable by making and using custom Directory and File classes that support jar:file: protocol. Here have sources of such classes: https://gist.github.com/aeroson/4c90349d1f1c5a079744 they require Ionic.Zip.dll which you can download here: https://dotnetzip.codeplex.com/

Nonetheless on android it errors out: ArgumentException: Encoding name 'IBM437' not supported You need to unzip your .apk then copy over all I8N*.dll from Unity installation and zip it again, more info: http://answers.unity3d.com/questions/378005/ioniczipdll-does-not-work-in-build.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Publishing of an artifact Unity in a repository 1 Answer

Unity wont install on android device 1 Answer

Is it possible to import the game made in Unity to Android Studio? 0 Answers

android app dont start on device after inistalation 2 Answers

Android Asset Bundles used in the editor 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges