Unity3d games cannot be deployed to Windows Phone8 on a mobile phone workaround

Source: Internet
Author: User

Today we have a unity3d game, ready to deploy to their Lumia 920, the data cable connection is normal, the operation is normal, but "build" after, always can not be deployed to the phone, nor in the selected directory to produce any related files.

But there is an error in the hint:

Error Building Player:Exception:Error:method ' system.byte[] system.io.file::readallbytes (System.String) ' doesn ' T exist in Target framework. It is referenced from Assembly-csharp.dll at system.byte[] Nguitools::load (System.String).It means there is a problem with the load () method inside the NGUITools.cs, which makes it impossible to deploy. Solution: Find the NGUITools.cs and find the Load () method. The code is as follows:?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     /// <summary>     /// Load all binary data from the specified file.     /// </summary>    static public byte[] Load (string fileName)     { #if UNITY_WEBPLAYER || UNITY_FLASH         return null; #else         if (!NGUITools.fileAccess) return null;        string path = Application.persistentDataPath + "/" + fileName;        if (File.Exists(path))         {             return File.ReadAllBytes(path);         }         return null; #endif     }

As long as the #if Unity_webplayer | | Add a "UNITY_WP8" to the back of the Unity_flash.

Full code:

?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20     /// <summary>     /// Load all binary data from the specified file.     /// </summary>    static public byte[] Load (string fileName)     { #if UNITY_WEBPLAYER || UNITY_FLASH||UNITY_WP8         return null; #else         if (!NGUITools.fileAccess) return null;        string path = Application.persistentDataPath + "/" + fileName;        if (File.Exists(path))         {             return File.ReadAllBytes(path);         }         return null; #endif     }

Then, following the deployment steps, build will see the game installed on your phone.

Resources:

http://www.tasharen.com/forum/index.php?topic=6625.0

Unity3d deployed to WP Mobile:

Http://game.ceeger.com/Manual/wp8-deployment.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.