Installing cordova-plugin-mixpanel causes build/package on Ionic Cloud to fail (iOS)


#1

Hi,

When I install cordova-plugin-mixpanel in my Ionic 2 solution and kick off a package/build on Ionic cloud for iOS it fails witht his error:

CompileC build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/Objects-normal/armv7/UIImage+MPAverageColor.o onestepcloser.to/Plugins/cordova-plugin-mixpanel/Mixpanel/UIImage+MPAverageColor.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/kc/f8g8tr7n1054j1nzrkkvyzpr0000gq/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=8.0 -g -fvisibility=hidden -Wno-sign-conversion -iquote /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/onestepcloser.to-generated-files.hmap -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/onestepcloser.to-own-target-headers.hmap -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/onestepcloser.to-all-target-headers.hmap -iquote /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/onestepcloser.to-project-headers.hmap -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/device/include -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/device/usr/local/lib/include -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/UninstalledProducts/include -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/UninstalledProducts/iphoneos/include -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/device -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/DerivedSources/armv7 -I/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/DerivedSources -F/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/device -Fonestepcloser.to/Plugins/cordova-plugin-googleplus -include /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/sharedpch/onestepcloser.to-Prefix-arlyvgrvkfcrwvaoyeebxaudellt/onestepcloser.to-Prefix.pch -MMD -MT dependencies -MF /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/Objects-normal/armv7/UIImage+MPAverageColor.d --serialize-diagnostics /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/Objects-normal/armv7/UIImage+MPAverageColor.dia -c /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/onestepcloser.to/Plugins/cordova-plugin-mixpanel/Mixpanel/UIImage+MPAverageColor.m -o /Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/build/onestepcloser.to.build/Debug-iphoneos/onestepcloser.to.build/Objects-normal/armv7/UIImage+MPAverageColor.o
/Users/package/workspace/apps-a0bfeb2c-46/cordova/platforms/ios/onestepcloser.to/Plugins/cordova-plugin-mixpanel/Mixpanel/UIImage+MPAverageColor.m:42:23: error: variable-sized object may not be initialized
char colorIndices[kNumberOfHexColors] = {0};

It seems it can be fixed by setting the “C language dialect” to default as described here: https://github.com/samzilverberg/cordova-mixpanel-plugin/issues/52


#2

Could you resolve this issue?