KDC
KDC

Reputation: 611

Building to iOS without Mac using Codemagic

I currently want to deploy my Flutter app to Apple's App Store but unfortunately I don't have a Mac since its quite expensive for me. However I found a workaround here and tried Codemagic to build and deploy the app to AppStore. However upon trying to build for iOS within Codemagic, I got an error and its:

== Building for iOS ==


== /usr/local/bin/flutter build ios --debug --no-codesign ==

/Users/builder/clone/ios/Runner/Info.plist: Property List error: Found non-key inside <dict> at line 7 / JSON error: JSON text did not start with array or object and option to allow fragments not set.
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.syncshopWebview for device (ios)...

Running pod install...                                          
    4.8s

Running Xcode build...                                          

Xcode build done.                                           60.5s


Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.9+1/ios/Classes/FlutterWebviewPlugin.m:91:22: warning: incompatible pointer to integer conversion assigning to 'BOOL' (aka 'signed char') from 'id _Nullable' [-Wint-conversion]
        _enableAppScheme = call.arguments[@"enableAppScheme"];
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.9+1/ios/Classes/FlutterWebviewPlugin.m:418:98: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
        [channel invokeMethod:@"onHttpError" arguments:@{@"code": [NSString stringWithFormat:@"%ld", error.code], @"url": url}];
                                                                                               ~~~   ^~~~~~~~~~
                                                                                               %ld   (long)
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.9+1/ios/Classes/FlutterWebviewPlugin.m:426:98: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
        [channel invokeMethod:@"onHttpError" arguments:@{@"code": [NSString stringWithFormat:@"%ld", error.code], @"error": error.localizedDescription}];
                                                                                               ~~~   ^~~~~~~~~~
                                                                                               %ld   (long)
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_webview_plugin-0.3.9+1/ios/Classes/FlutterWebviewPlugin.m:434:106: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
                [channel invokeMethod:@"onHttpError" arguments:@{@"code": [NSString stringWithFormat:@"%ld", response.statusCode], @"url": webView.URL.absoluteString}];
                                                                                                       ~~~   ^~~~~~~~~~~~~~~~~~~
                                                                                                       %ld   (long)
    4 warnings generated.
    2020-01-01 17:20:28.170 ibtoold[1414:18701] DEBUG: Added to environment: {
        TMPDIR = "/var/folders/r7/d9twdq011sb8d3q1p8f39cdr0000gn/T/763735EC-50B9-405B-83C2-E28A2CD2AD2C";
    }
    /* com.apple.actool.document.warnings */
    /Users/builder/clone/ios/Runner/Assets.xcassets:./AppIcon.appiconset: warning: A 76x76@1x app icon is required for iPad apps targeting iOS 7, 8, and 9
    /Users/builder/clone/ios/Runner/Assets.xcassets:./AppIcon.appiconset: warning: A 76x76@2x app icon is required for iPad apps targeting iOS 7.0 and later
    /Users/builder/clone/ios/Runner/Assets.xcassets:./AppIcon.appiconset: warning: A 83.5x83.5@2x app icon is required for iPad apps targeting iOS 9.0 and later
    /* com.apple.actool.document.notices */
    /Users/builder/clone/ios/Runner/Assets.xcassets:./AppIcon.appiconset/[][iphone][57x57][][][1x][][]: notice: 57x57 app icons only apply to iPhone apps targeting releases of iOS prior to 7.0
    /Users/builder/clone/ios/Runner/Assets.xcassets:./AppIcon.appiconset/[][iphone][57x57][][][2x][][]: notice: 57x57@2x app icons only apply to iPhone apps targeting releases of iOS prior to 7.0
    /* com.apple.actool.compilation-results */
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/AppIcon29x29.png
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/AppIcon57x57.png
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/[email protected]
    /Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/Assets.car
    /Users/builder/Library/Developer/Xcode/DerivedData/Runner-edaimyiflreloheqntgnhkmwcclv/Build/Intermediates.noindex/Runner.build/Debug-iphoneos/Runner.build/assetcatalog_generated_info.plist

    error: unable to read property list from file: /Users/builder/clone/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: Planning build
    note: Constructing build description

════════════════════════════════════════════════════════════════════════════════
Building a deployable iOS app requires a selected Development Team with a 
Provisioning Profile. Please ensure that a Development Team is selected by:
  1- Open the Flutter project's Xcode target with
       open ios/Runner.xcworkspace
  2- Select the 'Runner' project in the navigator then the 'Runner' target
     in the project settings
  3- In the 'General' tab, make sure a 'Development Team' is selected. 
     You may need to:
         - Log in with your Apple ID in Xcode first
         - Ensure you have a valid unique Bundle ID
         - Register your device with your Apple Developer Account
         - Let Xcode automatically provision a profile for your app
  4- Build or run your project again

For more information, please visit:
  https://flutter.dev/setup/#deploy-to-ios-devices

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Encountered error while building for device.



Build failed :|
Failed to build for iOS

Please bear with me with this, I cant totally follow the docs regarding the deployment of a Flutter app to AppStore since I dont have a Mac.

Thank you very much!

if you are looking for whats inside my info.plist here it is:

<?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>
    <key>io.flutter.embedded_views_preview</key>
    <true/>
    <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>SyncShop</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>

Upvotes: 0

Views: 1423

Answers (1)

MichaelM
MichaelM

Reputation: 5828

The start of your info.plist is invalid, it should look like this:

    <key>io.flutter.embedded_views_preview</key>
    <true/>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>

You can see that the io.flutter.embedded_views_preview has been pasted in between the existing CFBundleDevelopmentRegion and its value.

Upvotes: 2

Related Questions