Xamarin Debug -> iPhone, Failed to compile the generated registrar code. (MT4109) - ios

I'm trying to build up my App for testing on Device.
I'm facing an huge problem with the debugging:
The device is registered
I'm using a Dev Provisioning Profile
If I build and publish "release" no problem occurs
If I build Debug / iPhone I get:
/---PATH----/MTOUCH: Error MT4109: Failed to compile the generated registrar code. Please file a bug report at http://bugzilla.xamarin.com (MT4109) (---PROJECT NAME---)
Taking a closer look to the logs:
Process exited with code 1, command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -gdwarf-2 -I/Library/Frameworks/Xamarin.iOS.framework/Versions/9.0.1.29/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -Qunused-arguments -miphoneos-version-min=8.0 -arch arm64 -c -DDEBUG -o /---PATH---/obj/iPhone/Debug/mtouch-cache/registrar.arm64.o -Wno-receiver-forward-class -x objective-c++ -fno-caret-diagnostics -fno-diagnostics-fixit-info -
<stdin>:3804:35: error: type name does not allow storage class to be specified
<stdin>:3804:32: warning: declaration does not declare anything [-Wmissing-declarations]
Any suggestion?

If someone stumbles over this problem as I did:
Try adding --noregistrar to the additional mtouch arguments in the project's options (iPhone Build page).

Related

React Native Failed to build iOS project. We ran “xcodebuild” command but it exited with error code 65. The problem is with all projects

I am getting following Error when try to run any project with React-native run-ios:
I have already tried all solutions from this and many more but nothing works.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening proj.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace proj.xcworkspace -configuration Debug -scheme proj -destination id=13B67855-76F9-4755-A1A5-7B5AEBC6D1C5
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Prepare build
warning: The Legacy Build System will be removed in a future release. You can configure the selected build system and this deprecation message in File > Workspace Settings.
=== BUILD TARGET glog OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
Libtool /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/glog/libglog.a normal x86_64
cd /Users/user/Work/weber/mobile-app/proj-mobile/ios/Pods
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/glog -filelist /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Pods.build/Debug-iphonesimulator/glog.build/Objects-normal/x86_64/glog.LinkFileList -o /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/glog/libglog.a
=== BUILD TARGET DoubleConversion OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
Libtool /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/DoubleConversion/libDoubleConversion.a normal x86_64
cd /Users/user/Work/weber/mobile-app/proj-mobile/ios/Pods
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/DoubleConversion -filelist /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Pods.build/Debug-iphonesimulator/DoubleConversion.build/Objects-normal/x86_64/DoubleConversion.LinkFileList -o /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/DoubleConversion/libDoubleConversion.a
=== BUILD AGGREGATE TARGET boost-for-react-native OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET React-Core-AccessibilityResources OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
ProcessInfoPlistFile /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/React-Core/AccessibilityResources.bundle/Info.plist Target\ Support\ Files/React-Core/ResourceBundle-AccessibilityResources-React-Core-Info.plist
cd /Users/user/Work/weber/mobile-app/proj-mobile/ios/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools"
builtin-infoPlistUtility /Users/user/Work/weber/mobile-app/proj-mobile/ios/Pods/Target\ Support\ Files/React-Core/ResourceBundle-AccessibilityResources-React-Core-Info.plist -expandbuildsettings -format binary -platform iphonesimulator -o /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Debug-iphonesimulator/React-Core/AccessibilityResources.bundle/Info.plist
ProcessProductPackaging "" /Users/user/Work/weber/mobile-app/proj-mobile/ios/build/Pods.build/Debug-iphonesimulator/React-Core-AccessibilityResources.build/AccessibilityResources.bundle-Simulated.xcent
cd /Users/user/Work/weber/mobile-app/proj-mobile/ios/Pods
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/user/Library/Android/sdk/tools:/Users/user/Library/Android/sdk/platform-tools"
I had different looking errors and also similar to yours given here, every time due to
'Prepare build failed, legacy build etc etc'.
I simply changed the build system to new one from legacy one and all projects ran smoothly. Try it out and let me know if it works for you too.
The setting path is : Xcode->file -> workspace settings -> build systems

React-native: iOS wont install - libtool error

I test my app using react-native run-ios in the simulator, however today I just get a random error and have no clue on how to approach it since I com from web dev and have no clue on how to setup projects in xCode (well I have some idea but I don't want to further break the project)
This is the error I am getting:
libtool /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a normal x86_64
cd /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/tipsi-stripe/ios
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk -L/Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator -filelist /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Intermediates/TPSStripe.build/Debug-iphonesimulator/TPSStripe.build/Objects-normal/x86_64/TPSStripe.LinkFileList -lRCTPushNotification -weak_framework Stripe -framework PassKit -o /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lRCTPushNotification
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lRCTPushNotification is not an object file (not allowed in a library)
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
Analyze /Users/waltermonecke/Code_Projects/reactNative/lisdo/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)
The following build commands failed:
Libtool /Users/waltermonecke/Code_Projects/reactNative/lisdo/ios/build/Build/Products/Debug-iphonesimulator/libTPSStripe.a normal x86_64
(1 failure)
I guess this is the relevant part can't locate file for: -lRCTPushNotification, but I dont know how to properly remove the reference to that package.
Any help is welcome!

iOS simulator build issue - "library not found"

I need to create simulator build for Facebook review.
I have 2 targets in my project - the app sources & static library.
I have tried the steps described at Facebook tutorial.
I used next command:xcodebuild -arch i386 -sdk iphonesimulator8.1
But build failed with error
"library not found for -lOOyalaAllSources"
and one more
"The following build commands failed:
Ld build/Release-iphonesimulator/MyApp.app/MyApp normal i386"
OOyalaAllSources - the name of static library I used.
How can I fix this issues?

Error compiling freetype2 library for arm7 with OSX gcc: `limits.h: No such file or directory

I am trying to compile the freetype2 library for arm7, using Xcode's command line tools in OSX. I am using the following parameterisation of the project's configure script:
Compiling FreeType for iPhone?
These errors were produced when running the script:
configure:3426: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -E conftest.c
In file included from conftest.c:10:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
configure:3426: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc -E -traditional-cpp conftest.c
conftest.c:12: error: assert.h: No such file or directory
configure:3426: /lib/cpp conftest.c
/Volumes/DATA/filestore/development/libs/c/freetype2/extract/2.5.3/builds/unix/configure: line 1600: /lib/cpp: No such file or directory
configure:3465: result: /lib/cpp
configure:3485: /lib/cpp conftest.c
/Volumes/DATA/filestore/development/libs/c/freetype2/extract/2.5.3/builds/unix/configure: line 1600: /lib/cpp: No such file or directory
I can see that the missing files actually do exist in the directories output in the error messages.
CFLAGS and LDFLAGS contain the following parameter, which should allow for the inclusion of system header files:
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/
The other odd thing that I noticed with these error messages, is that the architecture identifier in the directory structures is i686-apple-darwin10. The -arch armv7 compiler flag is being used, so why are i686-apple-darwin10 directories being inspected at all?
* UPDATED *
I also tried parameterising the configure script as per another example:
https://stackoverflow.com/a/12594507/1704014
The following error terminated its execution:
checking for suffix of native executables... ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
configure: error: native C compiler is not working
This also indicates that a different target architecture (OSX 10.6) is being built against, not arm7.
Any help much appreciated.
The problem in my OSX build environment was the Xcode command line tools installation. I reinstalled the latest distribution of the tools, and was able to compile successfully from then on.
To build the freetype2 library for arm7 and arm7s architectures, I found the following suggested commands useful:
https://stackoverflow.com/a/12594507/1704014

ios - "libtool failed with exit code 1" after a clean

I was working on a project and all were going well until I decide to clean my project.
The following errors appears only when I run my app on simulator (working fine on a real device) :
Libtool /Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator/libShareKit.a normal i386
cd "/Users/Yaman/Documents/iOS - App à vendre/Homeless/Submodules/ShareKit"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only i386 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator -filelist "/Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Intermediates/ShareKit.build/Debug-iphonesimulator/Static Library.build/Objects-normal/i386/ShareKit.LinkFileList" -ObjC -all_load -lCopy -lDelicious -lDiigo -lEmail "-lEvernote SDK" -lEvernote -lFacebook "-lFlickr SDK" -lFlickr -lFoursquareV2 "-lGoogle Reader" -lInstagram -lInstapaper -lJSONKit -lKippt -lLinkedIn -lLogout -lOAuth "-lOpen in Safari" -lPinboard -lPrint -lReachability "-lRead It Later" "-lSave to Album" -lShareKitCore "-lSina Weibo" -lSSKeyChain "-lText Message" -lTumblr -lTwitter -lVKontakte -o /Users/Yaman/Library/Developer/Xcode/DerivedData/Homeless-gujyzhsiwenufvedlinbbtrizcpd/Build/Products/Debug-iphonesimulator/libShareKit.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified, -all_load invalid
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lReachability
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lReachability is not an object file (not allowed in a library)
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
I got these errors when running command xcodebuild directly from a terminal :
** BUILD FAILED **
The following build commands failed:
Libtool "build/ShareKit.build/Release-iphoneos/Static Library.build/Objects-normal/armv7/libShareKit.a" normal armv7
Libtool "build/ShareKit.build/Release-iphoneos/Static Library.build/Objects-normal/armv7s/libShareKit.a" normal armv7s
(2 failures)
Someone can figure out what's happened here ?
I just got this error. The project works very well, you add a new lib and BAM, build failed.
I my case, Xcode5 had added some special \" around my header search paths values.
Like that :
\"$(SRCROOT)/myproject/Libraries/lib\"
Quite impossible to find out, but when spending hours to find where is the problem, I finally tried to change to
$(SRCROOT)/myproject/Libraries/lib
And the build success came back... thanks Xcode!
The first error note says that compiling ShareKit failed, because Reachability is missing. I'd propose that you check your compiling environment has latest (or compatible) version of the library.
That's why libShareKit.a mentioned in last error note is missing and compiling your app failed. Try to compiling ShareKit alone and when it's done, try again the whole app.

Resources