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 james Tima_2 · Jul 04, 2013 at 01:02 PM · assetbundleassetbundles

assets bundle for ios

Hi guys

I want to make assets bundle for ios .i have done for web player but when i download that bundle for ios it show me error

he file can not be loaded because it was created for another build target that is not compatible with this platform.

Please make sure to build asset bundles using the build target platform that it is used by. File's Build target is: 6 (Filename: Line: 625) Failed to read file 'none' because it is corrupted. (Filename: Line: 444) The asset bundle ' https://dl.dropboxusercontent.com/u/76813056/Bundles/Bundle.unity3d' can't be loaded because it was not built with the right version or build target. here is my code for making assets bundle using UnityEngine; using UnityEditor; public class ExportAssetBundles { [MenuItem("Assets/Build AssetBundle From Selection - Track dependencies")] static void ExportResource () { // Bring up save panel string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d"); if (path.Length != 0) { // Build the resource file from the active selection. Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets); BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets); Selection.objects = selection; } } [MenuItem("Assets/Build AssetBundle From Selection - No dependency tracking")] static void ExportResourceNoTrack () { // Bring up save panel string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d"); if (path.Length != 0) { // Build the resource file from the active selection. BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path); } } } and for getting assets code is
IEnumerator Start() { //float timebefore; //float timeafter; //StartCoroutine("CheckInternetWorking"); // Download the file from the URL. It will not be saved in the Cache using (www = new WWW(BundleURL)) { yield return www; if (www.error != null) { Debug.Log("error = "+www.error); } AssetBundle bundle = www.assetBundle; Instantiate(bundle.mainAsset); bundle.Unload(false); } } please help me i am in trouble ,i want to make a assets bundle for ios and load on device and sorry for my english Thanks in advance
Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by foobuggy · Dec 09, 2013 at 07:16 PM

This post already has a valid answer, but on a side not you could also use:

EditorUserBuildSettings.activeBuildTarget instead of BuildTarget.iPhone

That way, your bundles should be built correctly for whichever platform you currently have chosen as the build target.

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
avatar image
0

Answer by Graham-Dunnett · Jul 04, 2013 at 02:21 PM

Switch build platform to iOS, then run your AssetBundle creation code again.

Comment
Add comment · Show 1 · 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
avatar image james Tima_2 · Jul 05, 2013 at 03:14 AM 0
Share

when i switch my platform web to ios and made assets bundle it automatically change my project to web,i switch ios but after making assets bundle its change automatically in web and that assets bundle shows me same error.

avatar image
0

Answer by madhur · Nov 09, 2013 at 06:46 PM

I had a similar issue and fixed it by changing a line in the ExportAssetBundles script. There in line BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.iPhone); Added BuildTarget.iPhone to the end.

Now it works.

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
avatar image
0

Answer by tatterson · Mar 15, 2016 at 08:50 PM

I was building the Asset Bundles for Android like so and it did not work:

BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.Android);

But when I changed to this, it worked:

BuildPipeline.BuildAssetBundles("Assets/AssetBundles", BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);

What a headache!

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

20 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 avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do you set asset bundle name on prefab through code? 0 Answers

Sharing user-generated content (with AssetBundle) 0 Answers

Addessable asset download once 0 Answers

How do you package/retrieve Asset Bundle Dependencies 0 Answers

Asset Bundle with script ? 0 Answers


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