Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Xcode could not locate source file: RakNetTypes.h (line: 320)

Discussion in 'iOS and tvOS' started by azupko, Jan 14, 2011.

  1. azupko

    azupko

    Joined:
    Nov 4, 2008
    Posts:
    21
    I'm getting this error on iPod 2nd Gen 4.2.1 - works fine on iPhones:

    Program received signal: “EXC_BAD_ACCESS”.
    warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
    Xcode could not locate source file: RakNetTypes.h (line: 320)


    It is directly related to an external lib i'm using in XCode. The lib is armv6/7, and this error crops up if i extend a base class from the library (again, only on iPod).

    This error also alternates with the FMOD createChannel error if i change the build architecture from armv6 to universal 6/7.

    Is there a special rule for using external libs that are compatable with all devices? This didn't begin happening until 4.2.1.

    I'm running out of ideas - anything new would help.

    thanks!
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    I just ran into this exact same problem. the issue was the way the library was compiled and the fix was to set the Target Platform in the build settings to Universal (arm6+arm7). That may or may not fix your issue but it can't hurt to try.
     
  3. ciaravoh

    ciaravoh

    Joined:
    Dec 16, 2009
    Posts:
    252
    Hello,

    you have a NULL usage somewhere in your code. I had this error each time I used a variable that is not populated and/or not declared.

    debug your code to find this NULL usage.

    RakNet has nothing to do with that kind of error, but I can promise it solved my problem.

    hope this help.
     
  4. azupko

    azupko

    Joined:
    Nov 4, 2008
    Posts:
    21
    Hey guys - thanks for the tips.

    I've tried changing architecture but all that results from that is the FMOD error in start() rather than the raknet error.

    As for the NULL possibility - the code works as expected on all other devices/os versions - and also works if i just include the source directly (rather than as a packaged lib). The debugger backtrace just tells me:

    #0 0x0044f1f0 in wrapper_managed_to_native_object___icall_wrapper_mono_get_native_calli_wrapper_intptr_intptr_intptr () at RakNetTypes.h:320
    #1 0x00000000 in ?? ()

    This happens if a class is simply extended - even if it is never used in any way. The odd thing about it is this error only happens if startRendering is called in AppController.mm - otherwise everything works as expected (just no unity is rendered). This lib also works with no errors in non-unity projects.
     
  5. azupko

    azupko

    Joined:
    Nov 4, 2008
    Posts:
    21
    I've narrowed down the problem to subclassing a class from the library that has properties or methods in it. For example:

    in SimpleLib:

    Code (csharp):
    1.  
    2. ///////////////////////////////////////////////////////
    3. SimpleTest.h:
    4. ///////////////////////////////////////////////////////
    5. #import <Foundation/Foundation.h>
    6.  
    7.  
    8.  
    9. @interface SimpleTest : NSObject {
    10.  
    11.     NSString *str;
    12. }
    13. -(NSString*) str;
    14. -(void)setStr: (NSString *)input;
    15.  
    16.  
    17. @end
    18.  
    19.  
    20. //IN UNITY XCODE PROJECT
    21. ///////////////////////////////////////////////////////
    22. Extender.h:
    23. ///////////////////////////////////////////////////////
    24.  
    25. #import <Foundation/Foundation.h>
    26.  
    27. #import "SimpleTest.h"
    28.  
    29.  
    30. @interface Extender : SimpleTest
    31.  
    32.  
    33.  
    34.  
    35. @end
    36.  
    37.  
    38.  
    39.  
    Extending any class will cause the error. Categories work, but they aren't what i need for this implementation.

    The lib is armv6+7, as is the unity project. If unity does not run (comment out startUnity), everything works fine.
     
  6. RazorCut

    RazorCut

    Joined:
    May 7, 2009
    Posts:
    393
    I had this same problem today. Adding this linker flag fixed the problem:

    -all_load
     
  7. mikolo

    mikolo

    Joined:
    Nov 27, 2009
    Posts:
    249
    this is an reference error if you referenced to objects wich does not exists in your scripts....check the Unity Console for unreferenced objects.
    In my case it was like this.

    i hope it helps somebody
     
  8. hernaez

    hernaez

    Joined:
    Aug 16, 2010
    Posts:
    19
    I have the same error, but the -all_load flag doesn't do anything for me. It only happens in one of our scenes from 10 that we got. We are currently building Xcode 3.2.5, iOS SDK 4.2. Unity 3.3

    We tried every type of combination of player settings: optimizations and nothing seems to work.

    Of course everything runs fine in other target platforms and we are not referencing objects that do not exist in our script / scene.

    Thanks
     
  9. azupko

    azupko

    Joined:
    Nov 4, 2008
    Posts:
    21
    It turned out my library had compile for thumb enabled! Unity guys helped me figure it out - it was just a while after this thread and I forgot about posting the fix! Hopefully thats the same problem you are seeing?