3

I'm getting an error in my build (using cordova 3.4):

Undefined symbols for architecture i386:
  "_iconv", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in zxing-all-in-one.o
  "_iconv_close", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in zxing-all-in-one.o
  "_iconv_open", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::string&, unsigned char const*, unsigned long, char const*) in zxing-all-in-one.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **

I'm pretty sure this comes from the phone gap QR scanner plugin, but I don't think it should be building i386 at all. The qrcode scanner seems not to have a library of that architecture.

How can I tell cordova not to build i386? Or did i miss something?

leech
  • 8,293
  • 7
  • 62
  • 78

2 Answers2

4

When you build you can specify what type of build to do:

cordova compile --device

or for i386:

cordova compile --emulator

That's what fixed it for me.

leech
  • 8,293
  • 7
  • 62
  • 78
  • Not sure how it fixed it for you. Modern macs are x86_64 and I (like others) build my library without the i386 slice. --device does works just as you said though. – Roy Falk Apr 24 '16 at 13:20
  • I figure it has something to do with the emulators we have configured. I haven't had this issue since using later versions of cordova – leech Apr 25 '16 at 16:01
0

I've been struggling with this for a few days too. I followed the guidance in Snips answer here to get it working for me

libiconv not linking to iOS project

Community
  • 1
  • 1
razorhead
  • 309
  • 2
  • 9