Expo Ios Build Does Not Contain Valid Info.plist? - ios

I have built a react native project with expo. Whenever I drag the finished .app file into my xcode window I get this error.
How would I go about fixing this?

We will need more info about your app to really help with this. As you are using Expo, you have no direct access to the Info.plist file for iOS. That would have to be maneuvered using the app.json.
You would need a specific configuration property based on what exactly is believed to be requiring a "Valid Info.plist" the message says.
See Expo's documentation on this here: app.json

Related

React Native iOS Entitlements file

I'm working on a React Native app that requires use of the camera/photo library. The functionality works in the iOS simulator, however when I test with a physical device I see the following error in the console:
sandbox extension creation failed: client lacks entitlements for path
Based on what I found in the documentation on the Apple development forum, I need to enable the App Sandbox configuration.
This is done by going in Xcode (13.1) to the project > signing & capabilities > click the plus button in the lower-left under TARGETS
When the dialogue box appears, there are various options. However, the sandbox is not one of them.
I found this S/O post that shows the location of the sandbox in the dialogue but does not describe in any detail how to actually add this to a project.
Sandbox extension creation failed: client lacks entitlements? for path:
In the case of a React Native application, how is this done? There is supposed to be a .entitlements file (where I belive the other entitlements should be listed), but I do not see one in the /ios directory in the React Native project or in X-Code. What directory is this located in or if it is to be created, which directory should it be added to? Thanks in advance.

How to test the purpose string of NSPhotoLibraryUsageDescription in iOS using Expo?

I've been struggling to verify if the purpose string for photo library access really is working as expected. It started with the application got rejected because it wasn't set.
Using expo-image-picker, it says in the docs that adding this into the plugins section in app.json should set the NSPhotoLibraryUsageDescription:
[
"expo-image-picker",
{
"photosPermission": "This allows you to upload a photo to your Appname profile."
}
]
Before I added this, I basically added NSPhotoLibraryUsageDescription to the plist key inside ios section in app.json. What I can see, both do exactly the same thing.
After building ios using expo build:ios I was able to verify that that the string existed in the Info.plist file:
<key>NSPhotoLibraryUsageDescription</key>
<string>This allows you to upload a photo to your Appname profile.</string>
Using Expo Go doesn't really help since when requesting permissions, it says "Expo Go" in the alert.
Also, I only have experience working with Expo / React Native, and have no access to a mac (or xcode).
When apple test this, it looks like this (according to their screenshot):
While the expected text should be:
This allows you to upload a photo to your Appname profile.
How can I verify that the purpose string is really set (and works) before submitting an application to App store?
My solution:
First I set up my app for an EAS build. If you're not familiar with that you should check out the docs: https://docs.expo.dev/build/introduction/
Basically you do this:
install eas-cli: npm install -g eas-cli
run eas build:configure to initialize an eas.config file.
configure your eas build profiles. Mine look like this:
I collapsed the submit block to hide my credentials. Sorry for the photo instead of code/text. The formatter kept messing it up.
Any way, trigger a build using eas build -p ios --profile development. Notice the simulator flag set to true. This will allow you to run this as a stand-alone binary in your simulator.
When your build completes, go to expo.io and log into your account. Click on your project and download the binary for your ios build (under the builds tab). Unzip the binary and drag it into your simulator. You may be prompted with a message that says that you need to start up your development server. Just follow those simple instructions and there you go. You'll be able to see if your NSPhotoLibraryUsageDescription string updated.
Admittedly, this can be a pain in the (insert donkey emoji here - still don't have one yet Apple....šŸ˜”) and you're kind of executing outside of the expo environment, but it solves the problem of wondering if your string has updated before posting to the store again.
Best of luck. Hope that helps.

iOS - Missing CFBundleIconName in Xcode 9.2

I am uploading build to release app using Xcode 9.2 built with iOS 11 SDK. Binary is archived and uploaded successfully, but I get the following email back.
Dear developer,
We have discovered one or more issues with your recent delivery for
"". To process your delivery, the following issues must be corrected:
Missing Info.plist value - A value for the Info.plist key
CFBundleIconName is missing in the bundle ''. Apps that provide icons
in the asset catalog must also provide this Info.plist key. For more
information see
http://help.apple.com/xcode/mac/current/#/dev10510b1f7. Once these
issues have been corrected, you can then redeliver the corrected
binary.
Regards,
The App Store team
I found a solution.
Missing CFBundleIconName in Xcode9 iOS11 app release
But i need little bit more. I don't want to use *.xcassets file for app icon. I want to use image in xCode project folder for app icon.
Is it possible in xCode 9.2? if yes then how?
Haven't seen this listed on any of the other posts but this was my issue.
Make sure to check the target membership of your assets directory! If you do not correctly link the membership here, you will get this same super-generic error(Apple should do something about the error messages).
The target membership should correlate directly to targets for which you are using the icons. For example, I use this single directory for both my main app, and watch app assets, you must specify this by selecting the appropriate member.
There is a direct option not to use app icon from Assets

Appcelerator Titanium Failed to parse app's Info.plist

Failed to parse app's Info.plist error. Is there someone know this solution?
Use SDK 5.5.0 or later for Xcode 8+ and iOS 10+. There was a breaking change in that releases so the CLI was updated to incorporate this changes. Thx!
Delete Build & Resources folders from root of the project. (These folders might not be there)
Clean the project and re-run the app, it should work.
If this doesn't work then there could be some other issues for which you need to provide more info on what stuffs are you using related to Info.plist file.

How to debug "Invalid Bundle" error which happens only after submitting to app store

I have a lot of frameworks in my app. App works fine in adhoc/enterprise release. Only if I submit to the app store for testflight testing I get this error email from apple:
Dear developer,
We have discovered one or more issues with your recent delivery for "My app's name here". To process your delivery, the following
issues must be corrected:
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
there is no specific information here. How can I debug it?
Got an answer from Apple Developer Technical Support which says it is a bug on Apple's side. this is the suggested workaround below which did not work for me:
To diagnose this issue, you should export the IPA you are sending to
the App Store from Xcode. Since IPAs are zip files, you can
decompress it by right clicking and saying Open With > Archive
Utility. You should find your main executable inside the unzipped
folder structure and run otool at the command line to see the library
list: otool -L
The list of paths you get should match what you find inside of your
IPA. All of your libraries should start with #rpath. A simple
comparison of everything in this list with the unzipped IPA folders
should reveal what is missing.
Once you know what is missing, go to your Xcode build phases setup.
There should be a build phase for either Copy Files or Embed
Frameworks that includes the missing library ā€” you should just add the
library to the list. If you donā€™t see either of these build phases,
you can recreate it by adding a new Copy Files build phase, setting
the Destination to Frameworks, and adding the library to the list,
ensuring that Code Sign On Copy is checked.
If you donā€™t find anything missing in your main binary, make sure to
do the same search on any other binaries you may have, like for a
watchOS app or an iOS app extension.
If you find that all of the frameworks are in this build phase, please
take a look at the Embedded Binaries section of your app targetā€™s
General page, and let me know if you see multiple levels of ../ next
to the binary that you found is missing.
Please let me know if it works for you!
I have encountered the same issue when uploading an app with watch support to the app store.
I was able to solve it with the hint from the first answer, using otool -L to analyze the binary from the ipa or xcarchive.
However, the problem was not with my frameworks (at #rpath) but with a swift lib. I noticed that libswiftWatchKit.dylib was missing in the frameworks folder.
The solution that worked for me was as simple as to set EMBEDDED_CONTENT_CONTAINS_SWIFT=YES in the build settings of the watch app (or the watch app extension, but not both). After that, all necessary swift libraries were correctly copied to the watch app path in the archive and upload to app store was working correctly.
Apparently, the watch app works and upload passes if you provide the necessary swift libraries only in the main app's folder.
After adding the custom Swift framework to my project I got this email after uploading the app to iTunes connect.
I got this email from iTunes store,
Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.
The fix is simple for this issue,
Step 1: Make sure your Custom framework is added to Embedded Binaries in General tab of your target.
Step 2: Under build settings,
Set Always Embed Swift Standard Libraries = Yes for your main project target.
And Set Always Embed Swift Standard Libraries = No for your custom framework target.
This solved my problem and I was able to upload binary to iTunes connect.
Ref
Tried all the above solutions and did not work for me.
I was experiencing this issue in Xcode 10.1 recently and all my frameworks were referenced correctly (did otool -L and everything lined up).
Seems there were some changes in the apple validation process, may be a bug, may not be on Apple's end, but all my prior builds uploaded and validated fine -- and I did not add any new frameworks since.
Upon uploading the binary to iTunesConnect, I'd see the following error:
Invalid Bundle - One or more dynamic libraries that are referenced by
your app are not present in the dylib search path.
Invalid Bundle - The app uses Swift, but one of the binaries could not
link to it because it wasn't found. Check that the app bundles
correctly embed Swift standard libraries using the "Always Embed Swift
Standard Libraries" build setting, and that each binary which uses
Swift has correct search paths to the embedded Swift standard
libraries using the "Runpath Search Paths" build setting.
MY SOLUTION:
After days of debugging, what worked for me was to disable 'Include bitcode for iOS content' upon uploading the archive from Xcode organizer. Seems that this option modifies the binary which caused the validator to fail.
Or you can disable bitcode in your Build Settings
My Problem:
I had the same error with embedded frameworks.
The App project has Custom Framework project
Inside the Custom Framework project is another Custom Framework project
The app built to the simulator and to devices with no problem but failed the Apple test, returning "Invalid Bundle".
I inspected the package just like Taha had been told to by Tech Support and everything was present and correct!
My Solution:
I restructured the project so that the two custom frameworks sit side by side and one is no longer embedded within the other.
This looks to be an Apple validation problem since everything works fine on devices and the simulator but the work around was straight forward.
In my case, in the build settings, this was fixed when I added the following to the build settings for the library:
DYLIB_INSTALL_NAME_BASE = #rpath
The clue was a linker warning: 'YourLibrary has an install name beginning with ā€œ/ā€, but it is not from the specified SDK'
Had same issue. This happened to me because one of my Framework target was added to main target in "Link Binary With Libraries" but was not added to "Target Dependencies" and "Embedded Binaries"
I also received a similar mail from Apple:
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"********. Please correct the following issues, then
upload again.
ITMS-90562: Invalid Bundle - One or more dynamic libraries that are
referenced by your app are not present in the dylib search path.
Best regards,
The App Store Team
I used my own framework for my watch app. I solved this issue by changing the framework option to "Embed Without Signing" in the Extension Target. The default option was "Do Not Embed".
I had the same problem, it was due to one framework not being present in the Frameworks subfolder in the app bundle.
I fixed it by adding a Copy Fields build phase, and adding the missing .framework file there.
This error message is also addressed in Apple Technical Note TN2435
Embedding Frameworks In An App: https://developer.apple.com/library/archive/technotes/tn2435/_index.html
You can find the error message under the heading "Missing Framework Bundle" with troubleshooting steps.
We had the same problem, and even after going through all the steps (see "Missing Framework Bundle"), the only thing that worked was disabling Bitcode.
So I struggled on this for two days. What it turned out to be was I had UITests checked in Archive for the Build for the Scheme I was archiving.
After unchecking it from Archive, re-archiving it, validating it (although validating it before always passed), and "Upload to AppStore" I did not get the e-mail from Apple informing me of Invalid Swift Support. Instead I got the e-mail that it'd been processed and is good to go!
In my case, I've had to add a framework from Notification App Extension to the main target (embed & sign in the main target, do not embed in the extension) - even though there was no mention about it in otool -L output.
Funny thing that Iterable official doc says that the framework should be embedded & signed in the extension - which would lead to another upload problem because of nested bundles.

Resources