NEHotspotConfigurationManager and NEHotspotConfiguration linker problem

Hello, everyone, I tried to use the new NEHotspotConfiguration class to connect to a Wi-Fi using the new SDK, however, I cannot build my project due to some linking issue.



Undefined symbols for architecture x86_64:

"_OBJC_CLASS_$_NEHotspotConfigurationManager", referenced from:

objc-class-ref in HomeViewController.o


So I have enabled the HotspotConfiguration capability in my project file.

At the top of my source file I wrote the following import code:


import NetworkExtension


I checked and NetworkExtension library is indeed linked correctly to my project, for example, I'm able to allocate the NEHotspotHelper class.

What could be the possible issue here?

Thanks


Had the same problem. Looks like it won't link if you choose an emulator target (x64). If you use a real device with Xcode, everything works fine.


Cheers.

Seems like adding architecture check around hotspot related code fixes the problem.


#if !arch(i386) && !arch(x86_64)
import NetworkExtension
#endif


You should also add this check for the code blocks where you are using NetworkExtensions.

NEHotspotConfigurationManager and NEHotspotConfiguration linker problem
 
 
Q