Injection III : Interposable conflict with BitCode - ios

I am using InjectionIII for code injection on Xcode 11.5 and MacOS 10.15.2. Setup guide says
To use injection, download the app from the App Store and run it. Then, you must add "-Xlinker -interposable" to your project's "Other Linker Flags" for the Debug target (qualified by the simulator SDK to avoid complications with bitcode).
I added flag as shown in screen shot, It runs fine on Simulator but for Device I get this error.
-interposable and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together
There is something wronng the way I have setup flags but I can't figure it out.

Currently InjectionIII can only work on simulators1. So you may want to specify "Other Linker Flags" only for simulators to prevent build error. Click the "+" icon in your image to select a target2:

Related

Unable to run my app on iOS 13. For a framework problem

I'm trying to test my project on my iPhone with iOS 13, using Xcode 12 beta 6.
The app crash on start and this is the message in the log:
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)
Someone can help me?
Thank you
This occurs because Xcode fails to sign the frameworks that are provided by SwiftPM with your app’s signing identity. It’s a known issue (SR-13343) in Xcode 12.
You can do these steps on third framework file to try fix :
select:Siging & Capabilites.
find : FrameWorks, Libraries, and Embedded Content.
change : the. "embed" of the third frameworks from "Do not Embed" to "Embed & Sign".
Go to Project Settings -> Target -> General -> Frameworks, Libraries, and Embedded Content -> Check that your custom framework has "Embed & Sign" option
add AppTrackingTransparency.framework to your project
In my case, I made a SPM framework and embedded then occurred this error.
I unchecked "Copy only when installing" in Build Phase of Embed Frameworks then works fine
you can also check this
Stripe iOS SDK via Swift Package Manager is installing, but crashing because "Library not loaded"
Don't Copy the Framework directly to your project. Adding 'Embed Pods Frameworks' manually works for me. Try It.
If you are asking permission for tracking via AppTrackingTransparency, you must addNSUserTrackingUsageDescription key to the info plist.

SIGABRT error loading app to iPhone after successful build and past successful deployment

I built an iOS app using Xcode 9 and deployed successfully onto iPhone X running iOS 11.4, but since updating iPhone to iOS 12 and Xcode updated to 10 my app builds successfully but then I get a SIGABRT error stating:
dyld: Library not loaded: #rpath/libswiftAVFoundation.dylib
Referenced from: /private/var/containers/Bundle/Application/3C7010B7-BC26-4638-AEAF-E3F45108826C/PaintingPortal.app/Frameworks/OmniVirtSDK.framework/OmniVirtSDK
Reason: image not found.(lldb)
I've done the following to try and resolve this:
I checked that OmniVirtSDK.framework is listed in frameworks folder.
I added to Runpath Search Paths to include $(inherited) and #executable_path/Frameworks.
I checked OmniVirtSDK.framework is listed in Embedded Binaries.
I checked OmniVirtSDK.framework is listed in Linked Frameworks and Libraries.
(I removed and added both of these to be sure they were valid attributes).
I re-ran clean and build several times.
I deleted the DerivedData folder, then clean and build as well.
I ensured AVFoundation.framework was listed above OmniVirtSDK.framework in the frameworks list and also in the Linked Frameworks and Libraries lists, in case order was relevant.
I ensured "Other Code Signing Flags" under Signing was blank.
I ensured "Other Linker Flags" under Linking included '_ObjC'.
I ensured "Strip Swift Symbols" under Deployment was set to 'No'.
All of these were the advice on any related forum entries that I could find, so I now need help to understand what to do to resolve the issue and obtain a successful app launch on my test device.

Google Maps works in simulator but not in device

Google Maps works in iPhone simulator, when I run my project on device, it is not working.
Here is error description:
CoreData: Failed to load optimized model at path
'/var/mobile/Containers/Bundle/Application/01B85FB4-C777-467D-9E61-92B4B3240B91/demo/GoogleMaps.bundle/GMSCacheStorage.momd/Storage.omo'
Add -ObjC to "Other Linker Flags"
(Build Settings -> Linking -> Other Linker Flags).
This solved it for me.
After I added this flag I received some errors regarding missing symbols (such as _CBAdvertisementDataManufacturerDataKey).
I added the Accelerate and CoreBluetooth frameworks in Build Phases -> Link Binary With Libraries.
try this link please see https://code.google.com/p/gmaps-api-issues/issues/detail?id=8524 for information about debugging
This has been fixed in 1.10.4.

Xcode 6 Archiving and get a warning "Skipping copy phase strip ,binary is code signed" when add "share extension" to target

I got this warning when I added share extension to my project and archiving it
warning: skipping copy phase strip, binary is code signed: /Users/xxxx/xxx/xxxx/Build/xxxx/Build/Intermediates/ArchiveIntermediates/xxxx/IntermediateBui ldFilesPath/UninstalledProducts/XXX.appex/XXXX
The old question does not provide and insight to correct this . So I decided to ask again.
Warning during archive App with iOS 8 Extension in Xcode 6
Can someone please explain why this is happening ? Is it because the extension target is already code signed? If so, how to solve it ?
I knew that setting "Strip debug symbols during copy" to "NO" can clear this warning . But it is not actually solve the problem. And what is the drawback of not "stripping debug symbol"? Because my archive size is still the same whether I set this to YES or NO
Do not disable Strip Debug Symbols During Copy in your application project. This will bloat your app (if you have other unsigned dependencies).
It occurs because building the application project attempts to strip the framework but it can't since the framework is already codesigned. However the framework has already been stripped during it's build, so the warning is harmless. Xcode isn't doesn't seem to detect that the codesigned framework has already been stripped.
You should leave it as is.
"Compiled code usually contains debug information. This debug stuff is
helpful for inspecting running code in debugger, but less so for the
optimized code you would ship in distribution builds. Therefore it
gets stripped out when doing an Archive build.
The problem here is that PBXCp is unable to strip out debug symbols
from signed binaries because this would invalidate the digital
signature. So if you have a project that was created before Xcode 6.3
you will now get a warning like this.
To fix the warning simply change both values to NO. Removing them does
not work because the default value is still YES for both. The project
templates that came with Xcode 6.3 have these turned off by default.
Only projects that were started with older templates still have YES on
the Release line."
Source: https://www.cocoanetics.com/2015/04/skipping-copy-phase-strip/
I experienced the same warning and solved it by setting "Strip Debug Symbols During Copy" to "NO" in Build Settings of the containing app(not the extension), as you knew.
On the other hand, changing the same setting of the extension had no effect. This make clear the actual meaning of the warning. That is, stripping symbol does not mean the symbols "of the target" will be striped, but does mean the target will try to strip symbols "of embedded binaries".
Consequently, I believe the actual meaning of the warning would be that Xcode can't strip out debug symbols of the extension binary while archiving the container app, because the extension binary which need to be embedded in the container app "was" already compiled and frozen by code-signing before Xcode tries to strip out symbols of the extension binary while archiving the container app.
It seems like Xcode's default build settings related to striping debug symbols of the embedded extension binaries needs to be correctly updated not to show this warning.
In my case was related with 2 AppIcons (I forgot the fill them) , check if you have all the AppIcons in the xxx.xcassets file with the right xxpt.
From here I beg Apple to improve this check or enable an auto-tool to complete all the AppIcons set. It is crazy.
If you are using Xcode 9.34.1, click in the project settings. Use the filter to find the correct setting: type "strip debug". You will find the settings COPY_PHASE_STRIP. Probably is set to "Yes". Set to "No" to remove the warning.

dyld: Library not loaded: #rpath/libswiftCore.dylib / Image not found

I am running my app from xcode to my iOS device and I get this and black screen on iOS device.
Console text:
dyld: Library not loaded: #rpath/libswiftCore.dylib
Referenced from: /private/var/mobile/Containers/Bundle/Application/10DB2FE8-EF09-4857-B4AC-0DB2E4419D6F/App-Name.app/App-Name
Reason: image not found
(lldb)
Try adding the following line to Runpath Search Paths of your target.
#executable_path/Frameworks
your_target -> Build Settings -> Linking -> Runpath Search Paths
I had this same issue. I ended up adding the framework in the following locations:
General > Embedded Binaries
General > Linked Frameworks and Libraries
Build Phases > Link Binaries with Libraries
The embedded binaries seemed to be the key for me.
For me helps adding #executable_path/Frameworks to the project Runpath Search Paths, not target.
your_project -> Build Settings -> Linking -> Runpath Search Paths
None of the other solutions helped me, but everything was fixed by deleting Xcode's Derived Data directory.
Oh yes. I've faced with that problem spending hours on solution.
You may try to set "Always Embed Swift Standard Libraries" to "Yes" under your Build Settings > Build Options
(don't forget to shift+cmd+K your project after)
I had to switch 'Embedded Content Contains Swift Code' to 'Yes' to get my Obj-C app to work after updating the Obj-C embedded framework with a Swift object.
In the Framework Target (not the app target), go to Build Settings > Build Options > Always Embed Standard Swift Libraries to YES.
This solved the issue for me!
I had this error in a command line project (Xcode 10.2 and macOS 10.14.3)
The solution was to update to macOS 10.14.4
Swift command line projects won’t run on macOS 10.14.3 and earlier unless you install the Swift 5 Runtime Support for Command Line Tools package. Without that package, Swift command line projects crash on launch with “dyld: Library not loaded” errors. (46824656)
From Swift 5 Release Notes for Xcode 10.2
In my case, This issue is coming in Objective-c project in which I am using a Swift framework (AirWatch SDK).
Solutions:
I have resolved this issue with Xcode 9.3 and 11.0.1 iOS as mentioned bellow steps :
Drag and drop your swift framework in your project and move in default Framework folder of your project.
Then add them as Embedded binaries as shown in screenshot.
Change your framework status from Required to Optional as shown in screenshot. (Build Phases > Link Binary with Library)
Set Always Embed Swift Standard Libraries to Yes in your build settings.
Set Subpath and select destination as Framework for your added framework in Build Phases> Embed frameworks
as shown in screenshot.
Hope it will help someone.
I have faced the same issue, setting the right code sign identity solved the problem(Build settings->Code Signing Identity).
As per Apple technical questions "All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run"
I fixed by deleting all from Xcode Derived Data directory:
~/Library/Developer/Xcode/DerivedData
Good luck all!
This error message can also occur when using a framework build in a different Swift version then the one currently being used, e.g. if you upgrade Xcode.
I had the same error message, that is how I solved it :
The issue came from the certificates generated automatically by Xcode. I had to revoke these certificates dans generate them back from developer.apple.com
The solution is then :
- Go to developer.apple.com / certificates --> Revoke certificates
OR go in Xcode > preferences > accounts > View details > select Sigining identities > clic setting whell > revoke
- Got to developper.apple.com and follow instructions to generate new certificates
- In Xcode in my project : go to Code Signing Identity and sign both Debug lines with the generated certificate
- Both release lines are set to "iOS Developer"
- Then project > clean
- Build and run on device
#Saikiran's answered worked.
My certificates were generated before iOS 8 was released. I revoked all my certificates and regenerated all provisioning profiles and it solved my problems immediately.
I don't have enough reputation to vote up #Saikiran's answer, but that definitely helped solving the problem.
For me has worked set the option
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
to YES in Project -> Build Settings -> Build Options
(Namirial framework through Cocoapods)
None of the above solutions worked for me. I changed the iPhone Developer Certificate trust settings in Keychain. It should be Always Trust. Change it to Use System Defaults. Double click the certificate in Keychain to open the option screen
Discovered that from this blog
I had the same error message, this is how I solved it :
This is happening because i changed bundle identifier, so i just put old bundle id and it started to work again
I already had the Runpath Search Paths set correctly, but it still didn't work. #Justin Domnitz's answer put me on the right track: Setting "Always Embed Swift Standard Libraries" to Yes in my target's build settings did the trick for me.
Seems this issue was caused by the inclusion of Swift file into objective-c custom framework. Also unsure if related but my app target was built in objective-c as well. Also building to simulator in debug. Haven't verified for release or archive build yet.
Additionally Runpath Search Settings for the project target were set to "#executable_path/Frameworks", within the target settings for the framework they were set to: "#executable_path/Frameworks" and "#loader_path/Frameworks".
After having tried rebuilding custom framework and reattaching to app target, clearing derived data folder and a couple other suggestions, what ultimately worked for me was changing the build setting within Project target for the custom framework project (not app target): "Always Embed Swift Standard Libraries" to "YES". It appeared not to matter what the setting for the app target was set to. I verified this by resetting the simulator and rebuilding. This is similar to Daniele Ceglia's answer but I wasn't able to add a comment and wanted to provide more clarity.
For me Cleaning the project solve the issue!
I got such issue, too
All other ways could not help me,
so I have done it on stupid way
created new project and pod install from scratch
and after confirmed it is working correctly, I copied all class files and storyboard files, at last done!
I think it is the last way for it, maybe could help you
I had a similar problem in an Objective-C project where I started to include Swift files.
In my case, I created two targets in the main project, and I added a Swift empty file, that creates a bridging header file and some configurations, but I only marked it as a member of one target. The first target works properly, but the second not, and I noticed that the differences in build settings were this setting:
Runpath Search Paths -> $(inherited) and #executable_path/Frameworks
And I also needed to reference Objective-C Bridging Header to the file that was created before:
Objective-C Bridging Header -> pathTo/Target-Bridging-Header.h
After adding this two settings, the second target started to work properly.
Try cleaning the build folder, I was having the same problem and I solved it this way:
Product -> Clean Build Folder
For Me restart simulator solved this problem.
I tried a bunch of the cases above and it didn't seem to solve my issue. I use git and cocoapods for a project, and the error went away as soon as I made a new commit.
I had this problem before in iPod touch iOS 9.3. And I used all the methods mentioned in this post, but none of them worked.
I checked my project setting. And in the other link flag, I found I added -Wl,-sectcreate,__RESTRICT,__restrict,/dev/null.
This flag prevents dyld insert in the jailbroken phone. When I delete this flag, the app can be launched again. I am not sure why it worked. Because in iPhone se iOS 10 I don't have to delete this line. But it did work in iPod touch iOS 9.3. So check it if you have the same situation like me.
Please check the *.framework If there is a _CodeSignature signature framework directory.
If there is no _CodeSignature folder,
Navigate to the Build Phases ,click + to add New Copy File Phase to create Copy Files.
after that, reference *.framework and choose Code Sign On Copy

Resources