34

flutter build ipa is failing on macOS v13.3 (Ventura) with Xcode 14.3 and Flutter 3.7.9.

Log output:

xcodebuild[83777:409216] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)

flutter run works without issues on iOS simulators.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Iceman
  • 447
  • 1
  • 4
  • 9
  • 2
    I have the same error. My problem started with Missing file libarclite_iphoneos.a (https://stackoverflow.com/questions/75574268/missing-file-libarclite-iphoneos-a-xcode-14-3) and when I apply the fix, run without issues on simulators but when I try to build ipa this error happens. – Fabio Apr 01 '23 at 01:19
  • Flutter now has the issue: https://github.com/flutter/flutter/issues/123903 – Fabio Apr 01 '23 at 01:35

19 Answers19

44

Currently this is the only one solution working for me to build Archive ipa. Without need to roll back to Xcode 14.2.

So the solution for now is, open ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh file.

Find this line:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi

to

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi

add -f and save the file.

This worked for me. Hope this helps.

Bm Mn
  • 489
  • 3
  • 5
  • 1
    It works for me. FYI : In case your file keep revert back. Don't open file with Android studio or Xcode. Use TextEdit to edit and save file. – Tri yulianto May 27 '23 at 01:23
20

You don't need to rollback to Xcode 14.2. The following steps worked for me in 14.3 version:

  1. Make sure you are handling version 11 as Target:

    In the podfile file...

    Replace

     post_install do |installer|
       installer.pods_project.targets.each do |target|
         flutter_additional_ios_build_settings(target)
       end
     end
    

    With

     post_install do |installer|
       installer.pods_project.targets.each do |target|
         flutter_additional_ios_build_settings(target)
         target.build_configurations.each do |config|
           config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
         end
       end
     end
    
  2. Make sure that debug is included within the LaunchAction Xcode schema. In the Runner.xcscheme file you need to be sure that something like that is included...

     <LaunchAction
        buildConfiguration = "Debug"
        //...more lines
     </LaunchAction>
    
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
David L
  • 1,134
  • 7
  • 35
  • 2
    The `IPHONEOS_DEPLOYMENT_TARGET` on its own didn't work, but the LaunchAction set to Debug resolved things for me. – Craig Rees May 12 '23 at 10:01
  • 1
    This saved me. Only needed to change the `buildConfiguration` to `debug`. – Nickolas de Luca Alberton Jul 18 '23 at 23:37
  • @NickolasdeLucaAlberton could you please help to show where the location of Runner.xcscheme in Xcode? could you please a screenshot? I have tried to find but I can't. really need your help – Alexa289 Jul 19 '23 at 08:53
  • 1
    @Alexa289 It would be easier for you if you opened your project search and searched for `LaunchAction`, it would take you right to it. But here it is: `/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme` The reason you can't find it is because it's not a loose file, it's inside your project's .xcodeproj file. Damn Apple with their files that contain files. – Nickolas de Luca Alberton Jul 20 '23 at 11:35
  • This saved me. Only needed to change the buildConfiguration to debug. – jancooth Aug 11 '23 at 20:00
8

I had the same issue. After doing flutter upgrade (from version 3.7.9 to 3.7.10) it worked again.

barbrady
  • 161
  • 9
  • 2
    Nice, it worked for me too. I was in version 3.7.7 and now at version 3.7.11 builds without any warning/error message. Note: I also made the modification in Pods-Runner-frameworks.sh file as suggested by Bm Mn in the above answer with Flutter version 3.7.7 and did not work. Maybe this two answers together is the solution. – Coala Jedi Apr 17 '23 at 22:19
4

I changed my build configuration from release to debug mode, and it builds successfully.

You can change the build configuration from Xcode. Go to the product tap, and then scheme. Edit the scheme and change it in a drop down menu to debug.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • hi Kiumars, could you please add a screenshot about this? it would really really help me as a non expert developer :) – Alexa289 Jul 18 '23 at 08:16
  • If you don't mind editing de file directly, the answer lies in my comment on one of the posts above. Path of the file that contains the `debugConfiguration` variable: `/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme` – Nickolas de Luca Alberton Jul 20 '23 at 11:52
2

Upgrade Flutter to 3.7.12 and then change the build configuration from release to debug mode. After that, the iOS simulator should working.

Thanks to Kiumars's answer.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • hi Kasidit, could you please add a screenshot about this? I mean how to configure from release to debug ? it would really really help me as a non expert developer :) – Alexa289 Jul 18 '23 at 08:18
  • please I really need it, I still can't find it – Alexa289 Jul 19 '23 at 08:56
2

Updating cocoapods to 1.12.1 fixed this for me.

domfz
  • 2,263
  • 2
  • 5
  • 10
1

Download Xcode for version 14.2, You can use the Xcode Select for this.

Cyril
  • 580
  • 2
  • 11
  • 23
1

I had that error, and I did fix it by following these steps:

  1. First I removed the Xcode 14.3
  2. I downloaded the Xcode_14.2
  3. installed it
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
  • Link to 14.2 seems to now be https://download.developer.apple.com/Developer_Tools/Xcode_14.2/Xcode_14.2.xip – Nick Apr 04 '23 at 12:40
1

In my case, two ways work for me. The first way is rollback Xcode (14.3) to (14.2). The second way is upgrade Flutter to 3.7.12 and then open the ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh file. Find this line

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink "${source}")"
fi

Change it to:

if [ -L "${source}" ]; then
echo "Symlinked..."
source="$(readlink -f "${source}")"
fi
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
figureAi
  • 11
  • 1
0

You could build iOS app in Xcode, and it will give you more specific reason about the error.

In my case, the reason is that ruby language's method name is changed.

enter image description here

I fixed the error by modifying from exists to exist in ReadDotEnv.rb. (.../ios/.symlinks/plugins/flutter_config/ios/Classes/ReadDotEnv.rb)

  if File.exist?("#{envs_root}../.envfile")
    envFilePath = "#{envs_root}../.envfile"
  elsif File.exist?("#{envs_root}/.envfile")
    envFilePath = "#{envs_root}.envfile"
debug_ing
  • 476
  • 3
  • 13
0

I change channel to master and run flutter upgrade. And rechange to stable channel and run flutter upgrade again. After that, my build work well.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mahan
  • 53
  • 1
  • 6
0

You can fix the problem by upgrading your Flutter version. Here is a change log to the official fix for Xcode 14.3.

Here

nifesi
  • 80
  • 7
0

In my case, I was at Flutter version 3.7.1 and upgrading to 3.7.12 solved it.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

check if your pods install correctly, this can happen if you forget to install pods for your ios app

schn
  • 11
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 03 '23 at 21:11
0

this suggestion works for me:

In the podfile file...

Replace

 post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
   end
 end

With

 post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
     target.build_configurations.each do |config|
       config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
     end
   end
 end

and change Supported Platforms to this enter image description here

Tomdwipo
  • 23
  • 5
0

Turns out you get this error if you need to agree to an update of the Program License Agreement (PLA) on https://appstoreconnect.apple.com/

If you open the app in XCode you will see a red error text about this on the screen where you select the development team. After accepting the license and clicking "Try again..." in XCode, it compiled normally in IntelliJ.

Magnus
  • 17,157
  • 19
  • 104
  • 189
0

This issue happened to me when creating a release version and running on the physical device via Xcode.

In the runner scheme settings make sure you have "build configuration" set to "debug"

alxkui
  • 1
  • 1
-1

Do:

Flutter clean

Or build clean from Xcode will work.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Paras Rai
  • 122
  • 1
  • 6
  • In what context? From the command line? Wouldn't that result in `Command 'Flutter' not found`? – Peter Mortensen Apr 29 '23 at 11:20
  • If you are getting command not found, the path to flutter is not setup properly Go through this or flutter official website https://stackoverflow.com/questions/50652071/flutter-command-not-found – Paras Rai Aug 14 '23 at 09:20
-1

This issue happens because you updated Xcode to version 14.3

To fix this issue you have to upgrade flutter to version 3.7.1 via this command:

$ cd flutter
$ git checkout 3.7.1
$ flutter build ipa
SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96