Skip to content

Why can I not run on iOS? “The sandbox is not in sync with the Podfile.lock” #19257

Closed
@briefness

Description

@briefness

Problem
I have tried to run on iOS but it threw error but at Android it can work.

Logs
Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
    
Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    diff: /Podfile.lock: No such file or directory
    diff: /Manifest.lock: No such file or directory
    error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Could not build the application for the simulator.
Error launching application on iPhone X.
``

Flutter Doctor
[✓] Flutter (Channel dev, v0.3.2, on Mac OS X 10.13.4 17E199, locale en-US)
    • Flutter version 0.3.2 at /Users/Wisit/flutter
    • Framework revision 44b7e7d3f4 (12 days ago), 2018-04-20 01:02:44 -0700
    • Engine revision 09d05a3891
    • Dart version 2.0.0-dev.48.0.flutter-fe606f890b

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/Wisit/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.3, Build version 9E145
    • ios-deploy 1.9.2
    • CocoaPods version 1.4.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 23.2.3
    • Dart plugin version 181.4445.29

[✓] VS Code (version 1.22.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.11.2

[✓] Connected devices (1 available)
    • iPhone X • 92E4AD04-D69D-4353-BDA3-299CE124A10F • ios • iOS 11.3 (simulator)

• No issues found!

Activity

zoechi

zoechi commented on Jul 11, 2018

@zoechi
Contributor

Did you try running pod install or pod update in ios/?

zoechi

zoechi commented on Jul 11, 2018

@zoechi
Contributor

Your Flutter version Channel dev, v0.3.2 is quite outdated.
Please update to the newest beta or probably currently better dev channel version.

briefness

briefness commented on Jul 12, 2018

@briefness
Author

I have tried to run pod install or pod update on iOS but it threw error.

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.3 17D47, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.0)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[!] Connected devices
! No devices available

briefness

briefness commented on Jul 12, 2018

@briefness
Author

I've tried a lot of things but there's still no solution.

zoechi

zoechi commented on Jul 12, 2018

@zoechi
Contributor

What dos pod --version print?

briefness

briefness commented on Jul 12, 2018

@briefness
Author

1.5.3

briefness

briefness commented on Jul 13, 2018

@briefness
Author

I don't know why?
I tried everything but there's still no solution.
Do I need to reinstall it?

added
c: crashStack traces logged to the console
platform-iosiOS applications specifically
toolAffects the "flutter" command-line tool. See also t: labels.
on Jul 13, 2018
briefness

briefness commented on Jul 16, 2018

@briefness
Author

So do i,but why? Version of the problem?I reinstall flutter but there's still no solution.

briefness

briefness commented on Jul 16, 2018

@briefness
Author

I ran flutter channel and saw I was in beta channel. I then ran flutter channel master to switch over. This fixed the problem for me.

zoechi

zoechi commented on Jul 16, 2018

@zoechi
Contributor

@briefness thanks for the feedback.
I'm going to close the issue. If this isn't fixed for others on dev or master channel, please create a new issue.

GuoZhiQiang

GuoZhiQiang commented on Apr 16, 2019

@GuoZhiQiang

When I run :flutter run or flutter build ios. I got this error:

Building com.ximalaya.qunfeng.qunfengFlutter for device (ios-release)...
Found saved certificate choice "iPhone Developer: xxxxxx@xx.com (U785VQF42P)". To clear, use "flutter config".
Signing iOS app for device deployment using developer identity: "iPhone Developer: xxxxxx@xx.com (U785VQF42P)"
Starting Xcode build...                                                 
Xcode build done.                                            2.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
    diff: /Podfile.lock: No such file or directory
    diff: /Manifest.lock: No such file or directory
    error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

Encountered error while building for device.

I solved it by adding the following settings to User-Defined Setting :

PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.

But there are some more things you should notice :

  1. Assume that you have run flutter run(or flutter build ios) successed after doing suggestion above.
  2. Then you want to run flutter build ios. First, you should remove the Settings PODS_ROOT = ${SRCROOT}/Pods and PODS_PODFILE_DIR_PATH = ${SRCROOT}/.. Second, run
 rm Podfile.lock
 rm -rf Pods/
 pod install
 flutter build ios

You will get the error again . Third, adding PODS_ROOT = ${SRCROOT}/Pods and PODS_PODFILE_DIR_PATH = ${SRCROOT}/. back again to User-Defined Setting.
3. Run flutter build ios.

epicquestgames

epicquestgames commented on Jul 5, 2019

@epicquestgames

This is issue every time I want to run my project on different machine...so annoying.
Only thing which works for me is to create "new" flutter project and import all files inside

Stef-GMS

Stef-GMS commented on Jul 5, 2019

@Stef-GMS

This helped me, thank you!

jamieastley

jamieastley commented on Nov 12, 2019

@jamieastley

I'm still getting this exact problem when I switch between work and home Mac's. Did anyone manage to work out the cause of this?

Varun7691

Varun7691 commented on Nov 20, 2019

@Varun7691

I just followed the below steps and that worked for me.

  1. Podfile already existed in my ios folder.
  2. cd ios
  3. pod install
  4. pod update

Hope this helps someone.

sksinghdev

sksinghdev commented on Jul 11, 2020

@sksinghdev

I just followed the below steps and that worked for me.

cd ios
pod install
pod update

then clean your project and build.

webkhushboo

webkhushboo commented on Feb 20, 2021

@webkhushboo

Its not working for me. I tried all the options but its keep giving the same error

diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
sksinghdev

sksinghdev commented on Feb 22, 2021

@sksinghdev

@webkhushboo You Just need to Run command 1) Flutter clean 4) update CocoaPods then Flutter run

github-actions

github-actions commented on Aug 5, 2021

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked as resolved and limited conversation to collaborators on Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleplatform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zoechi@Varun7691@jamieastley@GuoZhiQiang@webkhushboo

        Issue actions

          Why can I not run on iOS? “The sandbox is not in sync with the Podfile.lock” · Issue #19257 · flutter/flutter