Home > OS >  I'm new to Mac development in Flutter and I'm getting error on build
I'm new to Mac development in Flutter and I'm getting error on build

Time:01-27

I'm new to developing for Mac devices and I'm having a problem compiling the project, getting a "Found non-key" error. Where am I going wrong?

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

Below is 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>NSAppTransportSecurity</key>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>CFBundleDevelopmentRegion</key>
        <string>$(DEVELOPMENT_LANGUAGE)</string>
        <key>CFBundleDisplayName</key>

Someone to help me?

CodePudding user response:

You've screwed up your Info.plist. Change

    <key>NSAppTransportSecurity</key>
    <key>NSAllowsArbitraryLoads</key>
    <true/>

To

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>

And try not to edit the Info.plist manually, as it is very easy to make a mistake. Use the editor interface.

CodePudding user response:

I did that and now it has another error.

NSAppTransportSecurity now is line 4

Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device. /Users/builder/clone/ios/Runner/Info.plist: Property List error: Encountered unexpected element at line 4 (plist can only include one object) / JSON error: JSON text did not start with array or object and option to allow fragments not set. around line 1, column 0.

  • Related