Fails to distribute my app: "Your app contains non-public API usage." - ios

After I fixed some bugs and refactored my project which has been release on App Store, it fails to distribute. The Xcode shows the following error message:
Your app contains non-public API usage. Please review the errors, correct them, and resubmit your application.
The app references non-public symbols in Payload/XXX.app/XXX: UICreateCGImageFromIOSurface
XXX is the app name.
I've search the entire project, and didn't find any this keyword (UICreateCGImageFromIOSurface). How can I fix this?

Remove Reveal.framework from your project. This should not be linked in release mode of your binary.

You app contains code not only from sources, but from all statically linked libraries. You have to check all of those for containing private call. Looks like at least Reveal library contains it.

Double check any third-party libraries you are using in your project
I was facing the issue and after checking my pods file, I found that Look Back - Framwork which is available for debug builds only as for as I know. So removing that fixed the issue. Successfully submitted app through Xcode 6.1 for Apple Testflight beta testing :)

Never ship an app linked against the Reveal library. Reveal exposes
your app to deep introspection and will likely cause your app to be
rejected by the Apple review team. Reveal is intended for internal
development and debugging purposes only.
The Reveal service will stop automatically while the iOS host app is
not the frontmost app. It will automatically start again when the app
is re-opened.
Reveal supports inspection of applications compiled against iOS 6 and
later. The iOS Deployment Target build setting must also be 'iOS 6.0'
or later. You may see link errors if this is not the case.
Reveal uses Bonjour to connect with the running iOS application. If
you are running the iOS application on a device, it will need to be
on the same network as the Reveal Mac app to be able to connect with
it. If you have any problems connecting to your application check
your firewall and proxy setting to ensure they are not blocking
communications.
Find out more...

cordova plugin rm cordova-plugin-ionic-webview
cordova plugin add cordova-plugin-ionic-webview#4.1.0

Related

Can't get debug token for Firebase App Check for my Flutter iOS App

So I recently started setting up app check for my existing Flutter project (for both android and iOS platforms). I've had no problem with android's "Play Integrity", got the necessary debug token, and can successfully send and retrieve data to/from firestore (app check for firestore is currently enforced for my project).
The problem is, I can not get such a debug key for my iOS app. I will list the sources I've used and what I've tried so far.
I have firebase_app_check: ^0.1.1+8 installed via pubspec.yaml
I also added pod 'FirebaseAppCheck' to my Podfile
I have the necessary initialization code in my main.dart: await FirebaseAppCheck.instance.activate(...);
For "DeviceCheck", I am using THE SAME private key that I am using
for "Sign in With Apple" (which I have implemented successfully). I
have also enabled the checkbox for DeviceCheck in the settings of
that private key (in Apple Developer).
For my App ID (Apple Developer > Identifiers > App IDs), I have also
enabled the checkbox for "App Attest".
I have put "-FIRDebugEnabled" as an argument passed on launch in
XCode > Product > Scheme > Edit Scheme.
I always uninstall my app from my iOS simulator (iOS 16.2) or real device (iOS 16.1.2),
before trying again, because I have read across multiple forums that
the debug token only gets printed to the output the first time you
run your app.
I have also added these 4 lines of code in my AppDelegate.swift from here:
#if DEBUG
let providerFactory = AppCheckDebugProviderFactory()
AppCheck.setAppCheckProviderFactory(providerFactory)
#endif
Official firebase docs "iOS+ (App Attest)":
I have NOT copied ANY code from this page of the official docs, as I assume it's for native iOS apps only, and not for flutter, and I don't know where exactly I would have to put that code. I have only added the pod dependency and run pod install.
I don't have a .entitlements file.
So after all those steps, I'm apparently supposed to expect to find a debug token in my run output, as in:
Yet the only relevant output I can find is the following:
Runner[72719:33546579] 10.3.0 - [FirebaseFirestore][I-FST000001] AppCheck failed: 'The operation couldn’t be completed. (com.apple.devicecheck.error error 1.)'
If it matters:
I have NOT YET uploaded my iOS app to apple developer, app store connect or whatever (I'm not yet familiar with the process of publishing to the app store).
Neither have I uploaded my android app to Google Play console or created an app there (for this project).
Don't tell me anything about firestore rules. I already had that set up long ago, and everything worked just fine before I started integrating App Check.
Don't recommend any 3rd party plugins to me, I will only use official ones.
The firebase documentation says:
Tip: Confirm in your Xcode project's build settings that it passes the DEBUG flag to the Swift compiler
Try removing the '#if DEBUG' and '#endif' and run the app.
If it works, it mean you have missed that step
I was not able to find that build setting, so i just removed those lines from the AppDelegate, but i need to keep in mind to remove the other 2 lines while building the release mode
See this answer on the flutterfire Github issues page. Basically, call setAppCheckProviderFactory before GeneratedPluginRegistrant.register(with: self) in the app delegate file. I was investigating the same issue and it fixed it for me (the debug token was instantly printed out in Xcode's debug output). Hope it helps you as well!

AVFAudio Framework not present on macOS causes warning for iOS app (app should also be available on AS Macs)

My iOS app uses the AVFAudio framework to provide spoken feedback to the user while running. I would like this app to also run on Apple Silicon Macs (where the spoken feedback is not really necessary).
However, just importing the framework results in the following warning email after I upload to App Store Connect:
We identified one or more issues with a recent delivery for your app,
"App Name" 7.0 (24). Your delivery was successful, but you may wish to
correct the following issues in your next delivery:
ITMS-90863: Apple silicon Macs support issue - The app links with
libraries that are not present on Mac:
/System/Library/Frameworks/AVFAudio.framework/AVFAudio
I guess that this means the app will not be able to run on Macs.
How should I get this app to use the AVFAudio framework for iOS and still be available to run on macOS (AS Macs) with or without the framework on macOS?
Relevant code is:
import AVFoundation
class Speaker {
var speechSynth: AVSpeechSynthesizer
class func establishAudioSession() {
do {
try AVAudioSession.sharedInstance().setCategory(.playback, options: [.interruptSpokenAudioAndMixWithOthers, .duckOthers])
try AVAudioSession.sharedInstance().setMode(.voicePrompt)
try AVAudioSession.sharedInstance().setActive(true, options: [])
UPDATE / CLARIFICATION:
Note that my project does not include multiple targets. With multiple targets, this would be fairly straightforward. I am wondering if there is a way to achieve this by taking advantage of the newer AS Macs’ ability to run apps built for iOS without a separate target.
Is this possible when using this framework?
UPDATE 2:
I have submitted a support request to Apple for this now and their first suggestion was replacing
import AVFoundation
with
import AVFAudio
and then re-uploaded to App Store Connect, but after trying this, I get the same warning email back again. Will post an update (or hopefully an answer) when I hear back from them again.
I suppose your project has multiple targets defines (i.e. one for iOS and one for macOS). In the "General" tag of your target settings you can select which frameworks should be included under "Frameworks, Libraries and Embedded Content". Add your library for iOS, remove it for macOS.
If you share the same code you between apps you can also conditionally exclude some of it for macOS.
#if os(iOS)
// iOS only code
#endif
However, just importing the framework results in the following warning email after I upload to App Store Connect:
The problem probably isn't importing, but (as the message you got indicates), linking to AVFAudio, that's the problem. So solve that, you should select your app target in the Xcode project and go to the Build Phases tab. Look at the Link Binary with Libraries line and hit the disclosure button at the beginning of the line to reveal all the libraries that are linked into your app. Find AVFAudio and change the setting (there's a popup on the right side of the line) from Required to Optional. That'll let your app link to the framework if it's there, but still run if it's not.
But wait, you're not done yet... What do you think will happen if your app tries to actually use a framework that's not linked in (because it doesn't exist on the machine)? You'll get a crash, of course. To avoid that unhappy fate, you'll need to check for the existence of the framework before you use it. For example, you could do something like:
if NSClassFromString("AVAudioPlayer") != nil {
// do your AVFAudio stuff here
}
Further follow up from Apple support suggested the following:
Change back to import AVFoundation
Reduce the deployment targets from the latest and greatest back down to something less recent.
So I did both of these, changing the deployment targets from iOS 14.5 and macOS 11.3 to iOS 14.1 and macOS 11.0.
This has resolved (or worked around!) the issue.
I do want to deploy to the latest and greatest target for this particular app, so I don't consider it to be a complete solution as yet, but it will do as a work around for now. (I actually want to deploy to 15.0 when it's available to make use of the promised improvements to OSLogStore.)
So this sounds like a bug to me, and I have queried Apple for some further information on the issue, in particular, the ability to target more recent OS versions.

Ios share extension does not work when installed by testflight but works installed by xcode

Installed with testflight the application does appear in the list of target applications to share an image with. When I select my application icon in the list I do get a normal Post dialog. After pressing "Post" in the dialog the application does open but nothing else happens.
When the same version of application is installed with xcode the shared file is delivered and the application displays the shared image.
I am not even sure how to debug such an issue as the application installed by testflight does not appear in the list of installed applications in xcode Devices window. Nothing that I can find in device logs either.
Please suggest any approach to troubleshooting the issue.
Update: I found a way to get much more detailed logs from device than the one provided by xcode's "Devices" window: deviceconsole utility. This gives at least some information to approach troubleshooting.
Update 1: It turns out that the application installed through ad hoc ipa file exported from the same archive that was submitted to testflight shows the same problem. This allows much quicker testing turn around.
This answer indicates that the problem can be caused by "Deployment Target" of extension set above the ios version of test device. I did try different combination of this setting in the application and extension, nothing helped thus far.
Update 2: I created code-level support request with apple for this issue and provided full source of the application to them. After few months of apathetic communications they concluded that the problem is due to a bug and suggested to create report Apple Bug Reporter. I did that and after another few months of more apathetic communications the issue was promptly closed on the basis that the application does not crash. Frustrating, but I still need to resolve the problem, now looks like without help from vendor.
If the deployment target is higher than the version number of the actual phone, your code cannot run. So the only choice is reducing the deployment target of the extension to be the same as the app.
I’d check if you have somehow set different deployment targets for debug and release.

Fabric not sending data to my dashboard

I set you on situation:
I had a project 1.8.10 Objective C App that was without Fabric Crashlytics. So, when I got control of the project they told me that Fabric was already installed. I checked and yes, everything was good. Still, we updated the app to the 1.9.10 (totally different build number) and we set the itunnes connect deployment in 7 days. At first I believed that was something of Apple, but now we are in 100% and there's no data. Actually, I can't see my new app's version (1.9.10) in Fabric's dashboard.
(https://stackoverflow.com/a/41160905/9684719)
Yes: I have checked missing dYSIM, runscript, plist, at Debug information in my project I have DWARF with dSYM File.
Crashlytics not reporting crash in Release mode
Yes: I have my Fabric instantiation in Apps Delegate fine too.
Fabric doesn't update my latest build version
I can see in Itunes Connect that there is people using my app.

XE4 Deployment error

Good afternoon all. Apologies if SO isn't the place to ask, I wasn't sure there was an 'errors stack exchange' or such, and whether or not any XE4 users would be visitors there.
I'm currently trying out the XE4 trial, and I'm wanting to see just whether the iOS implementation is as easy as they made it look.
I've got my remote profile all setup and working, and I've made a small application that only contains a progress bar. Now, when I deploy that application to the simulator, it runs on the iOS simulator as expected.
However, when I try to deploy to a device, I get the following error;
[DCC Error] E2597 ld: warning: directory not found for option '-FC:\Users\Scott\Documents\RAD Studio\SDKs\iPhoneOS5.0.sdk\System\Library\PrivateFrameworks'
I've tried Debug, Ad-hoc, and App Store profiles, but they all return the same error. The folder 'PrivateFrameworks' doesn't even exist. There's one called 'Frameworks' in the 'Library' folder, but nothing else. I considered that maybe it's an incorrect SDK library path, but the only one with such a path is 'UIFoundation'. Changing the path to 'frameworks' like the others are returns this;
[DCC Error] E2597 ld: warning: can't parse __DATA/__objc_imageinfo section in C:\Users\Scott\Documents\RAD Studio\SDKs\iPhoneOS5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
That file DOES exist (99KB) but the error remains (and so I assume that changing the SDK lib path wasn't the right thing to do). It's like it's not even attempting to deploy over to the mac for compilation due to a file or folder issue.
Any ideas?
You could look at the checklist in the Troubleshooting: Cannot Deploy to the iOS Device help topic.
If you have not run your iOS app on the iOS Simulator, make sure you satisfy the requirements here:
Troubleshooting: Cannot Deploy to the iOS Simulator
Make sure your iOS device is connected to your Mac by USB cable.
Specify the iOS Device as the target platform in the Project Manager.
Complete the Provisioning page. (Your developer certificate is required for code signing)
Set the required Project Options for your iOS app:
Specify your application icons - Application Options.
Specify info.plist keys such as UIDeviceFamily - Version Info.
Install the Xcode command-line tools on your Mac. (Required for code signing your iOS app)
There are links in the documentation above with details about some of the steps involved.
I had extactly the same issue. It happened when trtying to deploy to the iOS 5.0 simulator (not even an iOS device).
It appears that UIFoundations (PrivateFrameworks) gets pulled across and cached when you setup the SDK for iOS 6.1 on XE4.
Make sure the sumulators are installed on Xcode in preferences. Restart Xcode (make sure the PA server is running). Setup a connection profile with the 6.1 SDK in options on XE4 and it works.
Hope this makes sense but it solved my issue.
Add the missing framework into your SDK. Tools->Options->SDK Manager, go to Frameworks and click the yellow button. Also remember to press "Update Local File Cache" after you're done. You will find that you will need to fetch more Frameworks and Libraries in the future.

Resources