I'm trying to get the file icon for my electron app to work properly on mac.
My package.json has:
"fileAssociations": {
"ext": [ "x" ],
"name": "X",
"description": "An x file",
"icon": "xFile.icns",
"role": "Editor",
"isPackage": false
},
And I also have in package.json:
"extend-info": "Info.plist"
which contains:
...<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>sql</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>xFile.icns</string>
<key>CFBundleTypeName</key>
<string>X File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>X</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>NSDocumentClass</key>
<string>SPDocumentController</string>
</dict>
</array>
<key>CFBundleURLTypes</key>
<array>
</array>
</dict>
</plist>
After I package it and move it to my Applications folder, I check the contents of the app and Info.plist wasn't extended with the info above.
Double-clicking to launch an .x file works though, just no icon replacement.
Can anyone confirm if my paths for the .icns file and .plist file is correct? Is it relative to the build folder or something else?
My file structure is according to the guidelines:
app folder:
> package.json, main.js, etc.
> build
> icons & Info.plist
I ran into this issue myself. First of all, your first snippet in package.json is related to Electron Builder not Electron Packager.
So if you plan to use electron-packager make sure that your npm run build script uses it and not builder.
Here is how I fixed the icon issue with Electron Packager:
In you config for electron-packager you'll point to the plist file, as well as add an entry to copy the icon file into the resources folder of the app.
In your electron-packager config you need these two entries:
extraResource: "app/icons/document-icon.icns",
extendInfo: "build-files/Info.plist"
Then in your plist you can just use the icon name:
<key>CFBundleTypeIconFile</key>
<string>document-icon.icns</string>
Finally, you might need to relaunch the Finder for it to take effect if you've already associated the file before.
Hope this helps!
Related
In my Flutter project, I try to compile and run my app. It works fine on Android but for some reason, out of nowhere, I now have the following error when I run my app on iOS:
2022-06-11 16:21:02.274 ios-deploy[42320:338779] [ !! ] [ ERROR] Could not determine bundle id.
Could not run build/ios/iphoneos/Runner.app on 00008030-001C085222DA803E.
So here is what I checked:
Info.plist: there is Bundle identifier with the value $(PRODUCT_BUNDLE_IDENTIFIER)
In TARGETS > Runner > Build Settings > Packaging > Product Bundle Identifier, I have the expected value (my package name)
In TARGETS > Runner > General > Bundle Identifier, the value is set as expected (my package name)
In TARGETS > Runner > Build Settings > Packaging > Info.plist File, I have the correct location: Runner/Info.plist
I tried flutter clean, Invalidate caches & Restart on Android Studio, Clean Build Folder on Xcode
I tried even more cleaning as explained here
And here is my Info.plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>$(APP_DISPLAY_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Wezeejay</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>ENVIRONNEMENT</key>
<string>$(ENVIRONNEMENT)</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>remote-notification</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>NSCameraUsageDescription</key>
<string>NSCameraUsageDescription</string>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
</dict>
</plist>
But I still have that error just when the app is about to launch, which I have no idea where it comes from since it was working perfectly just two days ago.
Does anyone know how to fix that?
Thanks.
Open the workspace file in xcode. Select runner from the side panel and select general tab. You should be able to see the bundle id. Add bundle id in this section
EDIT
/Users//Library/Developer/Xcode/DerivedData
remove all contents of this folder and from Xcode go to product, clean build folder and then build again
Change use Release for command line builds to debug and build once. Then switch it back to release
I finally managed to make it work by:
updating Mac OS
unstalling and installing the latest version of Xcode
im facing an issue in one of my flutter apps. Im was using MapBox-SDK plugin but when I tested the app on IOS, it asked me to update my Mapbox-sdk to some version (which I did using pop install command). Now after everything, I am facing new errors in my info.plist file. I forgot to take a backup of my old info.plist file.
Anyways, the new info.plist is:
<plist version="1.0">
<dict>
<string>YES</string>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>MGLMapboxAccessToken</key>
<string>Mapbox-key-not-visible</string>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<key>NSLocationAlwaysUsageDescription</key>
<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to location when open.</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>project1</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist
the error im facing while building up the app is:
ERROR:
Users/apple/flutter-practice/Project-Casky/casky/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 10 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Xcode build done. 24.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: unable to read property list from file: /Users/apple/flutter-practice/Project- Casky/casky/ios/Runner/Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 1.) (in target 'Runner' from project 'Runner')
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Runner editor. (in target 'Runner' from project 'Runner')
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
Exited (sigterm)
GUYS I can't find a solution to this. Kindly help me in anyway possible. Thanks in advance.
The error error: unable to read property list from file: Info.plist is usually caused by missing config on the plist file. As previously mentioned in the comments, you need to have a value set on NSLocationWhenInUseUsageDescription. More details are explained in the package's docs.
<key>NSLocationWhenInUseUsageDescription</key>
<string>[Your explanation here]</string>
In my case, it was because the Info.plist file was poorly formatted. It hasn't to do with XML format, because when I tried to find if that file was correctly formatted according to XML rules, it was ok, but when I tried to open the .plist file as a property list, I realized Xcode couldn't read it, so I added my keys using the property list utility, not the "code view".
I have been facing the same problem with a newly imported Flutter project. After some debugging, it seems like the issue was caused by a corrupt GoogleService-Info.plist file! Dunno why and how it was corrupted, because I have newly imported and existing project.
To solve this problem, you can follow those steps;
Open your project in XCode
delete the existing GoogleService-Info.plist file
download the original one from Firebase
then reimport/re-copy this file into your project
When this is done, run flutter clean then try running it in iOS Simulator
This worked for me, hope it solves your problem too.
I solved this issue by including <string/> after each <key>...</key> like this :
<key>NSPhotoLibraryUsageDescription</key>
<string />
<key>NSCameraUsageDescription</key>
<string />
<key>NSMicrophoneUsageDescription</key>
<string />
My app works perfectly when I'm running it on the simulator or device (for debug and release build configuration). But when I try to submit my app to the Apple Store I got the following error:
ERROR ITMS-90207: "Invalid Bundle. The bundle at 'APPNAME.app' does
not contain a bundle executable."
I tried to upload the archive with Xcode and Application Loader, without success.
I have tried some of the solutions found in this topic (Xcode App Submisson ERROR ITMS-90207: "Invalid Bundle) but none of them work with my project:
CFBundleExecutable is declared in my plist file as $(EXECUTABLE_NAME)
I tried to disable Bitcode
I tried to remove all CFBundleExecutable form Pods plist files (keep only the one from my target's plist)
Maybe this error is related to Xcode version... My mac is running macOS Sierra Version 10.12.6 Beta (16G8c), Xcode Version 8.3.2 (8E2002) and Application Loader Version 3.0 (620).
Any help is welcome.
UDPATE:
I try with Xcode 8.2, I have the same error.
Here is my plist file for more detail:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>APPNAME</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb000000</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>639</string>
<key>FacebookAppID</key>
<string>000000</string>
<key>FacebookDisplayName</key>
<string>APPNAME</string>
<key>FirebaseAppDelegateProxyEnabled</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>Description...</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Description...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Description...</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
UDPATE 2:
I managed to publish the archive from another mac with Xcode 8.2.1.
I try with Xcode version 8.2 an 8.2.1 on my mac, but I still have the same error.
I have also tried Application Loader version 3.0 and 3.6, without success...
So it looks like, the problem comes from my mac. I have no idea what to do.
I have contacted the Apple Developer Technical Support, and as #Larme suggest in the comments above, the error is due to my beta version of macOS.
Here is the full Apple support answer:
I looked at the .ipa you provided that was giving trouble, and
compared it to the one successfully submitted to the App Store. The
one giving you trouble was built on a beta version of macOS, which is
not supported for distribution. Apps released to the App Store need to
be built for a GM version of macOS, with a GM version of Xcode, using
a GM version of the iOS SDK.
Normally, apps submitted with any beta software receive a message
indicating this problem, and the message you received
was completely misleading.
I am going to complete the Bug Reporter form to report this bug.
Thanks everyone for your help.
Ridiculously enough, you also get this error if you try to submit a 9.0 deployment target app with XCode 9.1. Switchting the deployment target to 11.1 "fixed" it.
My hunch is that it is related to this: https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Chapters/Introduction.html
"Deprecations: Apps with a deployment target of iOS 11 no longer build a 32-bit slice. To build and include a 32-bit slice, set the deployment target to an earlier version of iOS. (32163517)"
I have an iOS app developed in Swift 2.1.1 with Xcode 7.2. The app runs perfectly and Xcode creates an archive with no problem, but upon uploading it to the app store (iTunes Connect) I get the following error:
ERROR ITMS-90207: "Invalid Bundle. The bundle at 'My App Name.app'
does not contain a bundle executable."
I have tried any suggestions I could find with no improvement whatsoever. How do I fix this issue? How can I find the cause? Is there a workaround?
I use several libraries with CocoaPods, my Podfile:
platform :ios, '8.0'
use_frameworks!
target 'My App Name' do
pod 'RealmSwift'
pod 'SwiftDateExtension'
pod "JDFTooltips"
end
target 'My App NameTests' do
pod 'RealmSwift'
end
My Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Text removed</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Text removed</string>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
I tried any suggestion I could find including:
Bundle id is set in app target, re-added info.plist (source)
CFBundleExecutable is set in the Info.plist (source)
Device connected or not makes no difference (source)
Disabling bit codes
I went into the archive to ensure it contains an executable and the Plist file links to it (from what I can gather) correctly. Even removed spaces in the name to ensure that's not the issue.
Turns out the NSHumanReadableCopyright broke the Info.plist. Completely removing the key from the Info.plist solved the issue (removing just the © character wasn't enough).
I think it's a fair suggestion to anyone experiencing a similar issue to try to submit an archive with a default, unmodified, Info.plist to see if that works. From my experience you can submit as many times as you want so don't hesitate to experiment.
I added the key because Apple suggests doing so in their documentation: https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW29.
Seems weird and stupid for their verification process to break and point to the executable when they can't interpret the Info.plist.
I have an *.ipa file that signed with AdHoc distribution profile. Also I have Xcode, app store profile, but have no source code of this app. Is there any way to resign my app for app store (I know, I can resign using, f.e. iResign, I did it, but with Enterprice builds) and submit it to AppStore?
Try creating a xcarchive bundle, and import it to Xcode.
A xcarchive is a folder with specific folders and files (Apple call that a bundle).
The folder structure of xcarchive:
MyApp.xcarchive (folder)
|
|-- dSYMs (folder, optional)
| |
| |-- MyApp.app.dSYM (the dSYM file for your app)
|
|-- Info.plist (metadata file)
|
|-- Products (folder)
|
|-- Applications (folder)
|
|-- MyApp.app (the app itself)
How to do it
Assume your app is called "MyApp".
First. rename your .ipa file to .zip, and unzip it. You will find your app in the unarchived "Payload" folder.
Then, create a folder, called "MyApp"
Create "Info.plist" file in the "MyApp" folder, with the following content: (replace the values accordingly)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ApplicationProperties</key>
<dict>
<key>ApplicationPath</key>
<string>Applications/MyApp.app</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.MyApp</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>SigningIdentity</key>
<string>iPhone Developer: Your Name (ABCDEFGHI)</string>
</dict>
<key>ArchiveVersion</key>
<integer>2</integer>
<key>CreationDate</key>
<date>2013-07-09T12:13:08Z</date>
<key>Name</key>
<string>MyApp</string>
<key>SchemeName</key>
<string>MyApp</string>
</dict>
</plist>
Create "Products" folder in the "MyApp" folder.
Create "Applications" folder in the "Products" folder.
Copy your app (that you found in the Payload folder in step 1) to the "Products" folder.
Now rename the "MyApp" folder to "MyApp.xcarchive", and you will find that its icon will change.
Finally, double click on the "MyApp.xcarchive", and it should be imported into Xcode.
In Xcode Organizer, submit the app to App Store as usual.
Hope this helps!