Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS archiving failed #95

Open
amrLLSE opened this issue Jun 12, 2024 · 16 comments
Open

IOS archiving failed #95

amrLLSE opened this issue Jun 12, 2024 · 16 comments

Comments

@amrLLSE
Copy link

amrLLSE commented Jun 12, 2024

Hello

I'm facing this error while archiving the app, it builds normally when building it to a device, but not archiving in XCode.

I have read the docs and added this to my pubspec.yaml, fully cleaned the project and caches in both flutter and ios module, updated CocoaPods to latest, unfortunately nothing works.

Prepare build
error: Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/Runner-fcxhffjmdtbzsbcfbguxqatlgxnj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SQLCipher.bundle'
    note: Target 'FMDB-SQLCipher' (project 'Pods') has create directory command with output '/Users/username/Library/Developer/Xcode/DerivedData/Runner-fcxhffjmdtbzsbcfbguxqatlgxnj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SQLCipher.bundle'
    note: Target 'SQLCipher-SQLCipher' (project 'Pods') has create directory command with output '/Users/username/Library/Developer/Xcode/DerivedData/Runner-fcxhffjmdtbzsbcfbguxqatlgxnj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SQLCipher.bundle'


Multiple commands produce '/Users/username/Library/Developer/Xcode/DerivedData/Runner-fcxhffjmdtbzsbcfbguxqatlgxnj/Build/Intermediates.noindex/ArchiveIntermediates/Runner/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SQLCipher.bundle'



Build failed    12/06/2024, 4:03 PM    20.7 seconds
@davidmartos96
Copy link
Owner

@amrLLSE Could you share your full pubspec.yaml file?

@amrLLSE
Copy link
Author

amrLLSE commented Jun 12, 2024

@davidmartos96 I have run flutter pub deps and these are all the results related to sql

├── cached_network_image 3.3.1
│   ├── cached_network_image_platform_interface 4.0.0
│   │   ├── flutter...
│   │   └── flutter_cache_manager...
│   ├── cached_network_image_web 1.2.0
│   │   ├── cached_network_image_platform_interface...
│   │   ├── flutter...
│   │   └── flutter_cache_manager...
│   ├── flutter_cache_manager 3.3.2
│   │   ├── clock...
│   │   ├── collection...
│   │   ├── file...
│   │   ├── flutter...
│   │   ├── http...
│   │   ├── path...
│   │   ├── path_provider...
│   │   ├── rxdart...
│   │   ├── sqflite...
│   │   └── uuid...
│   ├── octo_image 2.0.0
│   │   └── flutter...
│   └── flutter...
├── sqflite 2.0.3
│   ├── flutter...
│   ├── path...
│   └── sqflite_common...
├── sqflite_sqlcipher 3.1.0+1
│   ├── sqflite_common 2.5.4
│   │   ├── meta...
│   │   ├── path...
│   │   └── synchronized...
│   ├── synchronized 3.1.0+1
│   ├── flutter...
│   └── path...

And this is the part I have added from the plugin docs:

dependency_overrides:
  sqflite:
    git:
      url: https://www.github.com/davidmartos96/sqflite_sqlcipher.git
      path: sqflite
      ref: fmdb_override

My Dart & Flutter versions:
Dart SDK 3.3.4
Flutter SDK 3.19.6

In pubspec.yaml:

  sdk: ">=3.0.0"

@davidmartos96
Copy link
Owner

@amrLLSE Could you provide the pubspec.yaml file instead of the deps command? It might show other causes for the problem.

@davidmartos96
Copy link
Owner

@amrLLSE Also, is there any reason why you are running sqflite version 2.0.3 instead of the latest?
With the latest version of sqflite you don't need to provide the override for sqlcipher.

You can do flutter pub upgrade sqflite to update the dependency in your .lock. Latest version is 2.3.3

@amrLLSE
Copy link
Author

amrLLSE commented Jun 12, 2024

@davidmartos96 Unfortunately sharing any full file code from my project is against my company NDA, I hope you are understanding that 🙏 but sure I will assist you with anything I can do to resolve this issue. Can you explain more about that: (It might show other causes for the problem.) Causes like what?

I was just using latest sqflite but it produces the same issue, so I have tried this workaround. Now removed it and did flutter pub upgrade sqflite but the same issue happens.

@davidmartos96
Copy link
Owner

@amrLLSE It was in case some other dependency is adding sqlcipher as well, causing conflicts.
I would look for sqlcipher_flutter_libs in your .lock file, which is the other well known dependency for sqlcipher on flutter apps.
https://pub.dev/packages/sqlcipher_flutter_libs/changelog

@amrLLSE
Copy link
Author

amrLLSE commented Jun 12, 2024

@davidmartos96 Okay let me check that and get back to you.

@davidmartos96
Copy link
Owner

@amrLLSE You can also try to reproduce the issue in the example app in the repository.
It might take a few days until I can grab a macOS device to test the issue you are having.
If you try it we can at least know if it's a problem in your project or in the package.

@amrLLSE
Copy link
Author

amrLLSE commented Jun 12, 2024

@davidmartos96 No any other dependency is adding sqlcipher.

Okay I will try to reproduce using the example project and get back to you. Thanks so much for your understanding and support 🙏

@amrLLSE
Copy link
Author

amrLLSE commented Jun 12, 2024

@davidmartos96 It is reproducible on the example project, just open ios module in XCode and archive, the same error appears instantly.

@albrewot
Copy link

Having the exact same error. Started happening after updating XCode to the latest version a couple days ago

@davidmartos96
Copy link
Owner

@amrLLSE @albrewot
We have been able to reproduce it, but we are not sure what the solution is.
We were able to bypass the error by removing the SQLCipher dependency from the podspec in the ios/macos folder and only leaving FMDB/SQLCipher, which depends on SQLCipher transitively.
The problem with this is that we lose control over which SQLCipher version gets pulled. Latest would always be used, which sometimes might require changes in the plugin before updating, so this is not a reliable solution.

If anyone has more context on why this happens PRs are welcome.

@albrewot
Copy link

albrewot commented Jun 14, 2024

@amrLLSE @albrewot We have been able to reproduce it, but we are not sure what the solution is. We were able to bypass the error by removing the SQLCipher dependency from the podspec in the ios/macos folder and only leaving FMDB/SQLCipher, which depends on SQLCipher transitively. The problem with this is that we lose control over which SQLCipher version gets pulled. Latest would always be used, which sometimes might require changes in the plugin before updating, so this is not a reliable solution.

If anyone has more context on why this happens PRs are welcome.

@davidmartos96 On another project i was using an older version of this package (^2.2.0), downgraded from latest (3.1.0+1) to (2.2.0) on the project with the error and was able to archive on XCode, although now i need to lookout for possible bugs because of the downgrade.

@thanglq1
Copy link

@amrLLSE @albrewot We have been able to reproduce it, but we are not sure what the solution is. We were able to bypass the error by removing the SQLCipher dependency from the podspec in the ios/macos folder and only leaving FMDB/SQLCipher, which depends on SQLCipher transitively. The problem with this is that we lose control over which SQLCipher version gets pulled. Latest would always be used, which sometimes might require changes in the plugin before updating, so this is not a reliable solution.
If anyone has more context on why this happens PRs are welcome.

@davidmartos96 On another project i was using an older version of this package (^2.2.0), downgraded from latest (3.1.0+1) to (2.2.0) on the project with the error and was able to archive on XCode, although now i need to lookout for possible bugs because of the downgrade.

I'm facing the same issue. I need to downgrade to version 2.2.1 to archive it.

@negiwann
Copy link

Hi!
I archived the app using the following method.
Please change the "PRODUCT_NAME" and "CONFIGURATION_BUILD_DIR" settings using the Podfile.

@Boburshoh
Copy link

Please add the following code to your Podfile to resolve the build conflict issue by specifying a unique PRODUCT_NAME for the FMDB-SQLCipher target:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'FMDB-SQLCipher'
        target.build_configurations.each do |config|
            config.build_settings['PRODUCT_NAME'] = "FMDBSQLCipher"
        end
    end
    flutter_additional_ios_build_settings(target)
  end
end

This modification ensures that the FMDB-SQLCipher target has a distinct output name, preventing the 'Multiple commands produce' error during build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants