Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this plugin not work with your launchnavigator plugin? #270

Closed
1337 opened this issue Jan 10, 2018 · 3 comments
Closed

Can this plugin not work with your launchnavigator plugin? #270

1337 opened this issue Jan 10, 2018 · 3 comments
Labels
bug Something isn't working properly

Comments

@1337
Copy link

1337 commented Jan 10, 2018

Given the two plugins in config.xml, like so:

  <plugin name="cordova.plugins.diagnostic" spec="^3.6.5"/>
  <plugin name="uk.co.workingedge.phonegap.plugin.launchnavigator" spec="^3.2.2"/>

Other version numbers:

  • cordova: 7.0.0
  • cordova-android: 6.2.3
  • cordova-ios: 4.4.0

The Android build compiles successfully, but the iOS build does not. The last two lines of the log looked like this:

CompileC build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/LaunchNavigator.o App\ for\ poopoos/Plugins/uk.co.workingedge.phonegap.plugin.launchnavigator/LaunchNavigator.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/jenkins/Home/workspace/poopoo_reviews_ios/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:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/.nvm/versions/node/v6.11.4/bin:/usr/lib/jvm/jdk-8-oracle-x64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin"
    /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/v2/g_svkzvn05jg_xc1b_lpk5xh0000gn/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/iPhoneOS10.3.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=9.0 -g -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -iquote /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/App\ for\ poopoos-generated-files.hmap -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/App\ for\ poopoos-own-target-headers.hmap -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/App\ for\ poopoos-all-target-headers.hmap -iquote /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/App\ for\ poopoos-project-headers.hmap -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/include -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/usr/local/lib/include -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/UninstalledProducts/include -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/UninstalledProducts/iphoneos/include -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/DerivedSources/armv7 -I/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/DerivedSources -F/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build -FApp\ for\ poopoos/Plugins/cordova-plugin-background-fetch -FApp\ for\ poopoos/Plugins/cordova-background-geolocation -include /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/SharedPrecompiledHeaders/App\ for\ poopoos-Prefix-fpevazhexlsynkblafrjuzozazqu/App\ for\ poopoos-Prefix.pch -MMD -MT dependencies -MF /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/LaunchNavigator.d --serialize-diagnostics /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/LaunchNavigator.dia -c /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/App\ for\ poopoos/Plugins/uk.co.workingedge.phonegap.plugin.launchnavigator/LaunchNavigator.m -o /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/LaunchNavigator.o

Ld build/App\ for\ poopoos.app/App\ for\ poopoos normal armv7
    cd /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/Home/workspace/poopoo_reviews_ios/node_modules/.bin:/Users/jenkins/.nvm/versions/node/v6.11.4/bin:/usr/lib/jvm/jdk-8-oracle-x64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.3.sdk -L/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build -L/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/App\ for\ poopoos/Plugins/cordova-plugin-cocoalumberjack -F/Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build -FApp\ for\ poopoos/Plugins/cordova-plugin-background-fetch -FApp\ for\ poopoos/Plugins/cordova-background-geolocation -filelist /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/App\ for\ poopoos.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/App\ for\ poopoos_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/libCordova.a -weak_framework AudioToolbox -framework TSBackgroundFetch -lCocoaLumberjack -weak_framework SystemConfiguration -weak_framework AVFoundation -weak-lsqlite3 -framework TSLocationManager -weak_framework ImageIO -framework CoreLocation -lz -weak_framework PassKit -framework CoreTelephony -framework CoreBluetooth -framework CoreMotion -framework Photos -framework AddressBook -framework EventKit -framework Contacts -framework UserNotifications -framework MapKit -Xlinker -dependency_info -Xlinker /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.build/Debug-iphoneos/App\ for\ poopoos.build/Objects-normal/armv7/App\ for\ poopoos_dependency_info.dat -o /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App\ for\ poopoos.app/App\ for\ poopoos
duplicate symbol _LOG_TAG in:
    /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App for poopoos.build/Debug-iphoneos/App for poopoos.build/Objects-normal/armv7/Diagnostic.o
    /Users/jenkins/Home/workspace/poopoo_reviews_ios/platforms/ios/build/App for poopoos.build/Debug-iphoneos/App for poopoos.build/Objects-normal/armv7/LaunchNavigator.o
ld: 1 duplicate symbol for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld build/App\ for\ poopoos.app/App\ for\ poopoos normal armv7

If either plugin is removed from config.xml, iOS compilation succeeds.

Do you see anything relevant that might be the issue? Thanks


Exact same error for

  • cordova: 7.1.0
  • cordova-android: 7.0.0
  • cordova-ios: 4.5.4
  • cordova.plugins.diagnostic: 3.9.0
  • uk.co.workingedge.phonegap.plugin.launchnavigator: 4.1.2
@dpa99c
Copy link
Owner

dpa99c commented Jan 10, 2018

I can't actually reproduce this issue (see build.log below from my test case) but it's probably caused by a recent commit which brings the debugging functionality from the LaunchNavigator plugin across to the Diagnostic plugin.

Objective-C isn't my primary programming language, but I had understood that declaring a NSString*const limited its scope to the containing file/object. However, a bit of Googling turns up this SO answer which states:

NSString * const myString = @"foo"; // In one .m file only
defines a single variable myString which is visible "globally".

whereas

static NSString * const myString = @"foo"; // In .h file, included by multiple .m files
defines an myString variable locally in each "translation unit" (roughly speaking: in each .m source file) that includes the header file.

So it seems I need to make those LOG_TAG constants into static NSString * const to scope them to the containing file only. That should resolve your build error.

build.log

@dpa99c dpa99c added the bug Something isn't working properly label Jan 10, 2018
dpa99c added a commit to dpa99c/phonegap-launch-navigator that referenced this issue Jan 10, 2018
@dpa99c
Copy link
Owner

dpa99c commented Jan 10, 2018

@1337 I've just published [email protected] which contains a commit that should fix this, and also [email protected] with a respective fix.

Let me know if that resolves your build issue.

@1337
Copy link
Author

1337 commented Jan 10, 2018

That's it! Thank you. It's compiling fine. Compile log looks similar to yours.

@1337 1337 closed this as completed Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

2 participants