iOS: adding Admob ads into app giving an error - ios

My app was successfully running on both simulator and physical device. After adding AdMob into my app by following the instruction in this video , however, the app gives an error when building. I have tried several hours to look for the solution to this error, but could not find it. Do you have any suggestion for this? Thank you
ld: duplicate symbol _OBJC_CLASS_$_AppDelegate in /Users/joe/Library/Developer/Xcode/DerivedData/playSound-dxljeytitbiylehchltjsxksklbh/Build/Intermediates/playSound.build/Debug-iphoneos/playSound.build/Objects-normal/armv7/AppDelegate-B7F42A95B6FCD25F.o and /Users/joe/Library/Developer/Xcode/DerivedData/playSound-dxljeytitbiylehchltjsxksklbh/Build/Intermediates/playSound.build/Debug-iphoneos/playSound.build/Objects-normal/armv7/AppDelegate-B9769CE7F9C30755.o for architecture armv7
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1
Update:
Even I have not modified any code in my app, just add all the folder of 'GoogleAdMobAdsSdkiOS-6.1.4' in my project explorer as in the video, it then produces the error immediately. I am using xCode 4.2

This may be because 6.1.4 also comes packaged with a Google Analytics xcode project. Try making sure that you remove everything under the 'Add-ons' folder from being referenced in your project (unless you are using it).

You have multiple entries AppDelegate under Targets-Compiled Sources. Check it and ensure there is only one in Compiled Sources.

Related

XCode Project Invalid Bundle on App Store Upload

When submitting our app to the app store the validation process for the build keeps getting rejected with the following error.
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
Has anyone else had issues with this error? I feel like I've tried just about everything. I'd done the suggested otool -L on the main app as well as the watch app. The only library that it shows linked for is the Mixpanel library. The only other two libraries we are using is Fabric and Crashlytics. From my understanding those are not actual real frameworks? I've also tried to set ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES to YES as many posts online suggest. The project builds and runs fine so I'm completely lost as to how to resolve this issue.
This is a React Native iOS app if that has anything to do with it. I'm not the most experience when it comes to iOS stuff but I can find my way around xcode. Anyone have any suggestions? Maybe the best solution is to just create a new xcode project and set everything up again and copy/paste in the code from the previous project?

Implement AdobeCreativeSDK in an iOS project - can't validate archive

I need to implement Aviary photo editing in my iOS project. For that you need to add the AdobeCreativeSDKCore.framework and AdobeCreativeSDKImage.framework. I tried following their guide here and I also tried via cocoapods.
Adding the frameworks manually
When I add the frameworks manually, everything works fine, but when I try to validate the archive or upload it to testflight I get many errors. I get this as long as the frameworks are imported no matter if I try to use them in code or not. You can see the errors in this screenshot:
Using Cocoapods
I add the 2 pods, install and then add the "strip frameworks" script provided in the frameworks (as per Adobe's instructions). Like this I can archive, validate and upload without a problem, but when I use them in code and run the app it crashes on launch with the following error:
dyld: Library not loaded: #rpath/AdobeCreativeSDKCore.framework/AdobeCreativeSDKCore
Referenced from: /Users/rado/Library/Developer/CoreSimulator/Devices/13E81DE6-83DE-4ABC-9AEE-C498D25D8F2C/data/Containers/Bundle/Application/829ACA06-8150-4745-82F7-1ED4F86884E7/CrowdGraf.app/CrowdGraf
Reason: image not found
(lldb)
I'm stuck on this for over a week now. Any ideas how to fix this?

iOS Simulator crashes, device doesn't (dyld: Symbol not found)

it took me some time to solve this so I thought if someone ever searches for it also they might find the solution here.
The problem occurred when I had a framework called CoreUI. This worked fine on my iPhone and iPad but it crashes on the simulator with the following error to the terminal
dyld: Symbol not found: _OBJC_CLASS_$_CUICatalog
Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/UIKit.framework/UIKit
Expected in: /Users/sareninden/Library/Developer/Xcode/DerivedData/Treinplanner-bcfwuvntuwetsmavibxtvaiczpfg/Build/Products/Debug-iphonesimulator/CoreUI.framework/CoreUI
in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/UIKit.framework/UIKit
After looking through all the build settings and finding nothing I tried making an empty project with a framework called CoreUI. Without any logic added in it, it crashed with the same error.
It appeared that in the simulator CoreUI is also a framework name used by Apple. Even though it was a swift only framework this still causes conflicts.
This is how DYLD_FRAMEWORK_PATH works. Because you have your own CoreUI.framework in your DYLD_FRAMEWORK_PATH, that one is used instead of the system one to satisfy the linkage from UIKit.framework.
Don't pick framework names that are used by system frameworks, ie:
ls $(xcrun --sdk iphonesimulator --show-sdk-path)/System/Library/*Frameworks
The solution is to not use module names (for your app or framework) that Apple uses. I found a list of frameworks here (https://github.com/jonathanpenn/ui-auto-monkey/issues/8). I do not know if it is complete but it is a good start.

ld: library not found for -lgcc_s.1 when creating AIR iOS package with native extension

I'm trying to create an AIR native extension for iOS, but when try create the package to deploy to my device, I'm getting the following error:
ld: library not found for -lgcc_s.1
Compilation failed while executing : ld64
Its working when I try to create the app for the simulator. I've tried many combinations of adding libgcc_s.1 to my platform.xml file, creating just a package for iOS, creating a fat binary for both the simulator and the phone, etc.
I'm not sure why it needs the libgcc_s.1 package since I'm not referencing it in my extension. I tried adding it manually to the "Link Binary With Libraries" list in xcode, and at that point it won't build, telling me that libgcc_s.1.dylib doesn't exist on my system.
Do other people have this lib on their system? Does anybody know why it's being added if I didn't ask for it?
I finally solved this after days of searching and testing. Remove the -platformsdk option when packaging for device.

dyld isuess (Library not loaded)

I have this message when I build my project:
dyld: Library not loaded:
#rpath/iPhoneSimulatorRemoteClient.framework/Versions/A/iPhoneSimulatorRemoteClient
Referenced from: /Users/dev01/mobile/ios/Test/test/testTests/FoneMonkey/bin/iphonesim
Reason: image not found
This is dynamic link error and as I understand correct this error came because image not found. is this correct?
What steps should be taken to resolve errors?
I have found this link and as I understad this error came because I use xcode 4.3. Now I have try this on 4.2 and everething work good.
But I not have any idea how to run it on XCode 4.3
Maybe you have this problem after adding new library and you linked it in actual framework path, if you drag this library in embeded framework path then problem will solve. Another variant is that in build scheme you have enabled memory managment malloc, if you turn it off problem will be solved.
Check your SDK project settings (i.e. when passing from SDK 6.x to 7.x) maybe one of library was not compiled for architecture and project target. And the paths. Clean DerivedData and delete app from simulator (if it is there).
If you still need the Sdk just copy it from Xcode 4.6.(3) both for device and simulator and see if this solve your problem.

Resources