Undefined symbols for architecture armv7: “_SCNetworkReachabilityCreateWithAddress”

前端 未结 3 1134
终归单人心
终归单人心 2020-12-11 16:09

Right this has become a right pain I have been looking at it for 2 days now and can\'t seem to solve it. Here is the error I am getting.



        
相关标签:
3条回答
  • 2020-12-11 16:57

    I simply cleaned and restarted xcode and it worked.

    0 讨论(0)
  • 2020-12-11 17:07

    Normally, extra slashes won't muck up a UNIX-like build process.

    But, you do need to make sure the armv7 architecture is inside the framework file that your build is trying to use. To do this, use the lipo -info command at the command line:

    lipo -info /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer‌​/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks//SystemConfiguration.framework/Sy‌​stemConfiguration
    

    You should see output like this:

    Architectures in the fat file: SystemConfiguration are: armv6 armv7
    

    If you don't, your project is probably set up to link to the wrong version of the SystemConfiguration.framework. There's multiple versions of that framework on your machine. So, I would verify the path of the framework (i.e. SystemConfiguration) that you have in your project.

    Normally, I would expect that file to be something like this (adjusted for the OS version you're using):

    /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Lib‌​rary/Frameworks/SystemConfiguration.framework
    
    0 讨论(0)
  • 2020-12-11 17:07

    I have had this problem for about 8 hrs with a Cordova project and the org.apache.cordova.network-information plugin. By the answers above and several other answers, I was encouraged to search in the section Project > Target > Build Phases > Link Binary with Libraries of Xcode, which was right.

    But although SCNetworkReachabilityCreateWithAddress is defined in SystemConfigration.framework, I was not able to get rid of the linker errors by systematically adding and removing this and other libraries.

    Finally, I created a new project with the plugin and copied the framework constellation exactly as the original was. Now it's working.

    Conclusion:

    • If possible, create a new project with the necessary extensions and copy the constellations from it. It might help.
    • Sometimes, a library is too much included, so uncheck it. Sometimes it is the other way round.
    • To dig deeper, check the SystemConfiguration.framework as described in the outstanding answers above. It might mismatch the target architecture. Further, check for strange chars in build including paths.
    0 讨论(0)
提交回复
热议问题