Flutter Build Step Failing

Hi guys!

I’m enjoying a lot working on Bitrise, such a great tool, however, I’ve hit a problem when trying to build a Flutter project.

This error happens during a build step for the Flutter Step process.
Below I’ve attached a few more details about it.

Also, this is for sure a problem with https://pub.dartlang.org/packages/cloud_firestore, since this is almost the only packages I have on my project.

It was reproducible locally, but after a local update on Cloud Firestore to 0.7.2, now the error persists only on Bitrise.

Do you need more info in order to help me out? I appreciate it a lot!

Thanks,

Building <project-name> for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: xxx
Running pod install...
Xcode build done.
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
    
Xcode's output:
↳
    /Users/vagrant/Library/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.3/ios/Classes/FirebaseCorePlugin.m:13:17: warning: property 'dictionary' requires method 'dictionary' to be defined - use @dynamic or provide a method implementation in this category [-Wobjc-property-implementation]
    @implementation FIROptions (FLTFirebaseCorePlugin)
                    ^
    /Users/vagrant/Library/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.2.3/ios/Classes/FirebaseCorePlugin.m:10:46: note: property declared here
    @property(readonly, nonatomic) NSDictionary *dictionary;
                                                 ^
    1 warning generated.
    === BUILD TARGET gRPC-ProtoRPC OF PROJECT Pods WITH CONFIGURATION Release ===
    In file included from /Users/vagrant/git/ios/Pods/gRPC-ProtoRPC/src/objective-c/ProtoRPC/ProtoRPC.m:22:
    In file included from /Users/vagrant/git/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers.h:44:
    /Users/vagrant/git/ios/Pods/Headers/Private/Protobuf/GPBWellKnownTypes.h:40:10: warning: non-portable path to file '<protobuf/Any.pbobjc.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
     #import <Protobuf/Any.pbobjc.h>
             ^~~~~~~~~~~~~~~~~~~~~~~

other errors...

/Users/vagrant/Library/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.2/ios/Classes/CloudFirestorePlugin.m:322:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    /Users/vagrant/Library/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.2/ios/Classes/CloudFirestorePlugin.m:331:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    /Users/vagrant/Library/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.7.2/ios/Classes/CloudFirestorePlugin.m:340:37: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
          FIRTransaction *transaction = transactions[transactionId];
                                        ^
                                        self->
    12 warnings generated.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release ===
    Code Signing Error: No profiles for 'xxx' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'xxx'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
    Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.2'
    Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.2'
    Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.2'
Encountered error while building for device.
Flutter invocation failed, error: exit status 1

Do you invoke packages get Flutter command on bitrise?

1 Like

Hi @koral!

Here’s my Flutter Step config: doctor | packages get | clean | upgrade | build ios

Code Signing Error: No profiles for 'xxx' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'xxx'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.

Do you have signing configured? E.g. using certificate-and-profile-installer step in the workflow?

1 Like

Hi @koral,

I do have it, however, with the default env vars in there.
Also, I’ve added my Provisioning Profile and Signing Identity to Code Signing tab.

Should I take another step? Also, should I be using an iOS Stack to build a Flutter app for iOS?

Not sure if understand correctly, but if you only uploaded files to Code Signing tab it is not enough. They are not injected into VM on bitrise.io during build out of the box.

The easiest way is to use that step. It will download and install signing files. Here is more info: iOS code signing - Bitrise Docs

You can also use Hybrid stack but it must contain Xcode 9.

Would you mind sharing all your Steps that worked to build a Flutter app @koral?

However, even though there are code signing issues, log shows a lot more errors, always referring to either:

/Users/vagrant/git/ios/Pods/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginKit/FBSDKLoginManager.m:724:7: warning: block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior [-Wimplicit-retain-self]
         [_logger systemAuthDidShowDialog:didShowDialog isUnTOSedDevice:isUnTOSedDevice];
          ^
          self->

OR imports

/Users/vagrant/git/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers.h:59:10: warning: non-portable path to file '<protobuf/FieldMask.pbobjc.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]
     #import <Protobuf/FieldMask.pbobjc.h>
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             <protobuf/FieldMask.pbobjc.h>

Anyways, appreciate your help @koral, thank you

Finally, it worked.

For some reason, I had the Certificate and Profile Installer step after Flutter.
It was a matter of reordering it.

Thanks for your help @koral!

1 Like

Good idea, I’ll add sample steps to the Step documentation.

UPDATE:
@diegodurli here is the bitrise.yml snippet. I’ve also added it to the step description.

primary:
steps:
- certificate-and-profile-installer:
    inputs:
    - install_defaults: 'no'
- activate-ssh-key:
    run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- flutter:
    inputs:
    - commands: test|build ios|build apk
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.