News Forums General Discussion Windows Phone 8 export fails

This topic contains 8 replies, has 3 voices, and was last updated by  Sigil 10 months, 1 week ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #4618

    Imran Shafiq
    Participant

    SO I just followed the first tutorial in a fresh project and the export fails to generate the visual studio project.

    Error shown in Unity console is:

    Error building Player: Exception: Error: method ‘System.String System.Text.Encoding::GetString(System.Byte[])’ doesn’t exist in target framework.
    Error: method ‘System.String System.Text.Encoding::GetString(System.Byte[])’ doesn’t exist in target framework.
    Error: method ‘System.Void System.IO.File::WriteAllBytes(System.String,System.Byte[])’ doesn’t exist in target framework.
    Error: method ‘System.Void System.IO.File::WriteAllBytes(System.String,System.Byte[])’ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: method ‘System.Void System.Collections.Generic.SortedList’2::.ctor()’ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: method ‘System.Void System.Collections.Generic.SortedList’2
    ::Add(!0,!1)’ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: type ‘System.Collections.Generic.SortedList’2′ doesn’t exist in target framework.
    Error: method ‘System.Type System.Type::GetInterface(System.String)’ doesn’t exist in target framework.

    • This topic was modified 10 months, 1 week ago by  Sigil. Reason: Removed back ticks
    #4619

    Imran Shafiq
    Participant

    And as a follow up - Good news, the Windows 8 / Windows RT / Metro Store apps export was successfull. And the generated visual studio project is also running so everything is fine on the windows 8 side. But you have issues on the windows phone 8 side. Please please please fix the windows phone 8 export.

    #4620

    Imran Shafiq
    Participant

    For windows phone 8 here are some tips:

    1. Use SortedDictionary<key,value> instead of SortedList (or SortedSet<value> if that works)
    2. Use Type.GetInterface(string name, bool ignoreCase) instead of Type.GetInterface(string name) (There is also Type.GetInterfaces() that returns List<Type>)
    3. Use System.Text.Encoding.GetString(byte[] bytes, int index, int count) instead of System.Text.Encoding.GetString(byte[] bytes)
    4. File handling is a little involved on windows phone 8 due to “sandboxing” and “async” api’s. I cant tell the context of the error, what file are you trying to write to? where do you expect to store the file etc
    Please read this to understand how file handling works on windows phone 8

    http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681698(v=vs.105).aspx

    Please note that to accomodate all this, you will have to use the Plugin approach from Unity. In addition to your regular dll, you will do a wp8 specific dll with the changes mentioned above. Put your regular dll in Plugins folder whereas put your platform specific dll in Plugins/WP8 folder so Unity knows which dll to use when you are exporting to WP8.

    Again, if you need any help with this or want to get it tested on a daily basis, give me a holler. I really want RAIN on WP8!

    #4621

    Imran Shafiq
    Participant

    One last thought, I assume there is no file writing involved at run time, this must be for writing behavior tree to a file? In that case you can exclude this code from the WP8 plugin dll, but you may have to read the file in at runtime..

    #4635

    prime
    Keymaster

    Thanks for the detailed info. We’ll look into the issues.

    #6781

    Imran Shafiq
    Participant

    Any update on this? Has anyone successfully used this in windows phone 8 project?

    #6782

    prime
    Keymaster

    Yes. We’ve built a number of Win Phone apps with it.

    #7383

    Imran Shafiq
    Participant

    I just tried exporting with RAIN 2.0.10.2399 to Windows Phone 8.

    I still get the error a I reported a long time ago

    Error building Player: Exception: Error: method ‘System.String System.Text.Encoding::GetString(System.Byte[])’ doesn’t exist in target framework. It is referenced from RAIN.dll at RAIN.BehaviorTrees.BTNode RAIN.BehaviorTrees.BTLoader::LoadNode(RAIN.Serialization.ObjectElement,System.Collections.Generic.List’1,System.Reflection.Assembly).
    Error: method ‘System.String System.Text.Encoding::GetString(System.Byte[])’ doesn’t exist in target framework. It is referenced from RAIN.dll at RAIN.BehaviorTrees.BTNode RAIN.BehaviorTrees.BTLoader::LoadNode(RAIN.Serialization.ObjectElement,System.Collections.Generic.List’1
    ,System.Reflection.Assembly).
    Error: method ‘System.Void System.IO.File::WriteAllBytes(System.String,System.Byte[])’ doesn’t exist in target framework. It is referenced from RAIN.dll at System.String RAIN.Navigation.NavMesh.RecastNodes.CompactSpanGrid::GenerateRegionImage().
    Error: method ‘System.Type System.Type::GetInterface(System.String)’ doesn’t exist in target framework. It is referenced from RAIN.dll at System.Boolean RAIN.Serialization.FieldSerializer::DeserializeTypeFromElement(RAIN.Serialization.ObjectElement,System.Type,System.Object,System.Object&).

    • This reply was modified 10 months, 1 week ago by  Sigil. Reason: Removed back ticks
    #7390

    Sigil
    Keymaster

    Sorry about that, it looks like we missed these. Our next release (which shouldn’t be too far out) will have the fixes for these errors.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.