Flutter plugin fails to build on iOS

0 votes

I've installed flutter_nearby_messages_api and there is an error when building the iOS app:

 Failed to build iOS app
[        ] Error (Xcode): Multiple commands produce '/build/ios/Debug-iphonesimulator/Runner.app/Assets.car'
           
[   +1 ms] Could not build the application for the simulator.
[        ] Error launching application on iPhone 14 Pro Max.

I've even tried to rebuild the flutter plugin myself and got the same error after adding s.dependency 'NearbyMessages' to the <plugin>.podspec file. I'm not an iOS developer, but i think it has to do with CocoaPods somehow.

This is in the Podfile.lock of the flutter plugin:

PODS:
  - Flutter (1.0.0)
  - flutter_nearby_messages_api (0.0.5):
    - Flutter
    - NearbyMessages
  - GoogleInterchangeUtilities (1.2.2):
    - GoogleSymbolUtilities (~> 1.1)
  - GoogleNetworkingUtilities (1.2.2):
    - GoogleSymbolUtilities (~> 1.1)
  - GoogleSymbolUtilities (1.1.2)
  - GoogleUtilitiesLegacy (1.3.2):
    - GoogleSymbolUtilities (~> 1.1)
  - NearbyMessages (1.1.1):
    - GoogleInterchangeUtilities (~> 1.2)
    - GoogleNetworkingUtilities (~> 1.2)
    - GoogleSymbolUtilities (~> 1.1)
    - GoogleUtilitiesLegacy (~> 1.3)

I hope someone can help me, i would have added a issue but the flutter plugin is not on a public repository.

Mar 31, 2023 in Flutter by Ashwini
• 5,430 points
1,711 views

1 answer to this question.

0 votes

It looks like the error is related to CocoaPods, which manages dependencies for iOS projects. The error message suggests that there are multiple commands trying to produce the same file, which can happen when there are conflicting dependencies.

To fix the issue, you can try the following steps:

  1. Make sure you have the latest version of CocoaPods installed by running pod --version in your terminal. If you don't have it installed or if it's an older version, you can install it by running sudo gem install cocoapods.

  2. Delete the Podfile.lock file and the Pods directory in your project directory.

  3. Run flutter clean in your terminal to clear any cached build artifacts.

  4. Open the iOS project by running open ios/Runner.xcworkspace in your terminal.

  5. In Xcode, select the Runner target and go to Build Phases > Copy Bundle Resources. Make sure that there are no duplicate entries for the Assets.car file.

  6. If you still encounter the error, try removing the NearbyMessages dependency from the plugin's podspec file and see if the project builds successfully without it. If it does, then the issue may be related to that dependency.

  7. If removing the dependency doesn't fix the issue, you can try manually adding the dependency to your project's Podfile by adding pod 'NearbyMessages' and running pod install in your terminal.

If none of these steps work, you may need to reach out to the plugin's developers for further assistance or consider using a different plugin for your project.

To know more, join our Flutter Course today.

answered Mar 31, 2023 by chandru

Related Questions In Flutter

0 votes
1 answer

flutter app not running on ios simulator after adding firebase notification

The error message you provided seems to ...READ MORE

answered Apr 10, 2023 in Flutter by vishalini
5,204 views
0 votes
1 answer

How to change flutter project name and id?

Yes, it is possible to change the ...READ MORE

answered Mar 20, 2023 in Flutter by pooja
4,700 views
0 votes
1 answer

How can I change the app display name build with Flutter?

Yes, you can change the app display ...READ MORE

answered Mar 21, 2023 in Flutter by venky
2,558 views
0 votes
1 answer

How to change Android minSdkVersion in Flutter Project?

Yes, you can change the minSdkVersion in ...READ MORE

answered Mar 21, 2023 in Flutter by Tej
10,962 views
0 votes
0 answers

iOs build fails with FacebookLogin package

I'm currently using the Facebook Login package for ...READ MORE

Nov 10, 2022 in Mobile Development by gaurav
• 23,260 points
784 views
0 votes
1 answer

Flutter project in iOS emulator takes forever to run, but its worked on Android emulator

Try flutter clean and flutter build ios ...READ MORE

answered Nov 18, 2022 in Mobile Development by gaurav
• 23,260 points
619 views
0 votes
1 answer

Why is applicationWillTerminate not being called on the first launch of my app?

The applicationWillTerminate method is called by the ...READ MORE

answered Mar 18, 2023 in Android by vishalini
1,919 views
0 votes
1 answer

Linking 3 Flutter Projects in One Flutter Project

Yes, it is possible to combine multiple ...READ MORE

answered Mar 20, 2023 in Flutter by vinayak
664 views
0 votes
1 answer

How to get build and version number of Flutter app?

You can get the build and version ...READ MORE

answered Mar 29, 2023 in Flutter by pooja
1,236 views
0 votes
1 answer

How to make flutter app responsive according to different screen size?

To make your Flutter app responsive according ...READ MORE

answered Mar 27, 2023 in Flutter by anonymous
7,228 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP