Cannot run application on simulator after installing Xcode 11 - CFBundleVersion error

后端 未结 16 1355
醉梦人生
醉梦人生 2020-12-15 02:50

Yesterday, I\'ve downloaded beta version of Xcode 11. After that, I\'ve opened my project and tried to run with new Xcode. Unfortunately error has occurred with message:

相关标签:
16条回答
  • 2020-12-15 03:30

    I faced a similar issue for hours, this is what actually worked for me.

    1. Navigate to the Resources folder
    2. Find Info.plist
    3. Add a key-value pair: CFBundleShortVersionString:
    4. Clean Build Folder
    5. Clear Device Cache
    6. Run and Build
    0 讨论(0)
  • 2020-12-15 03:31

    It's a new feature in Xcode11.

    In release note it said:

    Bundles without a CFBundleVersion are invalid and can’t be properly installed on devices or simulators. CoreSimulator now checks and rejects such bundles earlier in the process with a clearer error message. (49892531)

    You can:

    1. Edit your CFBundleVersion by the style of this LINK
    2. Reset your Xcode and simulator
    3. Run again, you will see it works again

    When you run app in simulator success, you can change back your CFBundleVersion again, you will found it still can work XD

    0 讨论(0)
  • 2020-12-15 03:32

    If you get the following running error.

    (* see the attached screenshots below)

    This is how you can to solve this issue.

    Done in few steps.

    Step 1) Go to your project navigator in Xcode.

    • find the info.plist then select it

    Step 2) In the info.plist.

    • Select the (Bundle Version) field.

      Change it is value to a single digit, from (4.0) to (4) instead. by removing any decimal period.

    Step 3) Add a * (Bundle versions string, short) below the (Bundle Version)

    // Hint: Select the + sign to browse it if necessary .
    

    Step 4) In the Value field (String), add the version, but with decimal period this time.

    So if the (Bundle Version) is 4, make sure to add a period to it 4.0

    • See this picture for guidance.

    Step 5) Build Succeed.

       Happy Coding :-)
    
    0 讨论(0)
  • 2020-12-15 03:34

    I was confronting this problem yesterday. The situation is that I pull my code from git and tried to compile, after that, I may not able to run my app on the simulator (Or archive app to submit to the app store, the version number has not been put into archive info list, no version information as 1.3.4(123)). The error message is CFbundleVersion is not correctly setup. My Xcode version is 11.4 (11E146).

    so I tried following the method:

    1. Fix the CFBundleVersion in your Info.plist.(setup correct version format, numbers or X.X.XX)

    2. change the Bundle identifier, for instance, add a prefix address com.example to com.example.test. Then try to compile and install the app on the simulator. Right now, you could see the app can install normally.

    3. Then change Bundle identifier to your original one, such as com.example. Then try again, you will see you could install the app on the simulator or archive normally.

    0 讨论(0)
提交回复
热议问题