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

Fastlane "increment_build_number" not working after update Fastlane or xcode... #3877

Closed
mcactive opened this issue Mar 22, 2016 · 17 comments
Closed
Assignees

Comments

@mcactive
Copy link

Hi!

Just updated both Fastlane and Xcode to the latest version and both increment_build_number and increment_version_number are not working anymore... It doesn't throw an error, it just doesn't update.

The xcode project hasn't been changed at all... The code is pretty straight forward:

increment_build_number build_number: $appJson['version_no'] increment_version_number version_number: $build_number

Complete fastfile:

platform :ios do


    desc "Test!"
    lane :test do

        # This doesn't require any thing, because it is all done in the "Before all lane"
        set_info_plist_value(path: './Roadmap-Info.plist', key: 'CFBundleIdentifier', value: "$(PRODUCT_BUNDLE_IDENTIFIER)")

        # Set identifier
        update_app_identifier(
          xcodeproj: 'Roadmap.xcodeproj', # Optional path to xcodeproj, will use the first .xcodeproj if not set
          plist_path: 'Roadmap-Info.plist', # Path to info plist file, relative to xcodeproj
          app_identifier: 'com.demo.test' # The App Identifier
        )

        increment_build_number build_number: '6.1.2'

        increment_version_number version_number: '20160322'
    end

    # After no errors!
    after_all do |lane|

        p "We finished succesfuly!"

    end

    # Error!
    error do |lane, exception|
        puts "We crashed.... Send me an e-mail!"
        # Do something!
    end
end

Output:

[15:05:18]: ------------------------------------
[15:05:18]: --- Step: increment_build_number ---
[15:05:18]: ------------------------------------
[15:05:18]: $ cd /Users/roadmap/Documents/MobiPoweriOS && agvtool new-version -all 6.1.2
[15:05:18]: ▸ Setting version of project Roadmap to:
[15:05:18]: ▸ 6.1.2.
[15:05:19]: ▸ Also setting CFBundleVersion key (assuming it exists)
[15:05:19]: ▸ Updating CFBundleVersion in Info.plist(s)...
[15:05:19]: ▸ Cannot find "Roadmap.xcodeproj/../              <key>INFOPLIST_FILE</key>"
[15:05:19]: --------------------------------------
[15:05:19]: --- Step: increment_version_number ---
[15:05:19]: --------------------------------------
[15:05:19]: $ cd /Users/roadmap/Documents/MobiPoweriOS && agvtool new-marketing-version 20160323
[15:05:20]: ▸ Setting CFBundleShortVersionString of project Roadmap to:
[15:05:20]: ▸ 20160323.
[15:05:20]: ▸ Updating CFBundleShortVersionString in Info.plist(s)...
[15:05:20]: ▸ Cannot find "Roadmap.xcodeproj/../              <key>INFOPLIST_FILE</key>"

Environment

fastlane version (fastlane -v): 1.67.0
xcode version: 7.3
Do you use bundler, rbenv or rvm? RVM

@TKBurner
Copy link

Hi @mcactive. Thanks for letting us know. Can you edit to include your fast file?

Follow the template here: https://github.com/fastlane/fastlane/blob/master/ISSUE_TEMPLATE.md

Also, what version of Xcode are you using?

Thanks!

@mcactive
Copy link
Author

Hi!

Yeah, I've stripped the Fastfile to exclude all the errors and even the simplest doesn't work. I've edited the post!

Xcode version is the latest, 7.3

@i2amsam i2amsam self-assigned this Mar 22, 2016
@i2amsam
Copy link

i2amsam commented Mar 22, 2016

@mcactive I found a similar issue from a long time ago about a bug with cocapods. Are you using cocapods? Could you check your project.pbxproj CocoaPods/CocoaPods#613?

@mcactive
Copy link
Author

@i2amsam Hi Sam, yes, we are using cocoapods and using the cocoapods action in Fastlane as well.

The file appears to be XML instead of the OpenStep format.. Is there an easy way to fix it?

@i2amsam
Copy link

i2amsam commented Mar 22, 2016

@mcactive does this solution work? CocoaPods/CocoaPods#613 (comment) it seems like a cocapods issue rather than a fastlane issue.

@mcactive
Copy link
Author

@i2amsam you're right... Saving something in xcode and running only
cd /Users/mcactive/Documents/Project && agvtool new-version -all 6.1.2
works...

But it's weird if it is a cocoapods issue as it always worked and after updating fastlane and xcode it broke... Should I make an issue at CocoaPods?

@i2amsam
Copy link

i2amsam commented Mar 23, 2016

@mcactive I agree, super weird. I don't see anything in the fastlane release that seems suspicious, and we didn't run into it with an updated xCode, let's see if anyone else reports it.

@mcactive
Copy link
Author

@i2amsam updating to the beta version of cocoapods fixed the issue. This also installs "xcodeproj" beta which fixes a bug in Xcode 7.3:

1.0.0.beta.3
@segiddins segiddins released this 29 days ago · 3 commits to master since this release

Bug Fixes

Fix ASCII .xcodeproj serialization with Xcode 7.3.

@vfog
Copy link

vfog commented Mar 24, 2016

Ran into the same issue. We're using Cocoapods as well, but it isn't part of our fastlane flow. However, I do have a custom action that use the Xcodeproj gem that is used internally by Cocoapods in order to modify the project to swap out app icons, fonts, etc.

Based on your current finding I would suspect that a change in the xcodeproj structure in Xcode 7.3 has caused an incompatibility with the Xcodeproj gem.

For now I'm working around the issue by having the increment_build_number and increment_version_number actions be executed first in my lane. I had initially tried to get around the issue by running my custom action after those above two actions, but was still running into conflicts. Once I moved the two increment actions above update_project_team, update_info_plist, and update_app_identifier then things begun to work fine.

@kcharwood
Copy link
Contributor

@vfog I think you are exactly right. I'm seeing the same, and not using cocoapods.

@kcharwood
Copy link
Contributor

@mcactive @vfog I've verified updating to xcodeproj 1.0.0 beta 3 fixes this for me. I am not using cocoapods.

Fastlane may need to bump the minimum version of xcodeproj to resolve this.

[sudo] gem update xcodeproj --pre

@kcharwood
Copy link
Contributor

@mcactive I believe this one should be reopened until its resolved.

@mcactive
Copy link
Author

Didn't know fastlane also used Xcodeproj gem. Will reopen it until further notice.

@mcactive mcactive reopened this Mar 25, 2016
@kcharwood
Copy link
Contributor

Look like its defined here.

I think this needs to be bumped to minimum 1.0.0.beta.3

@i2amsam
Copy link

i2amsam commented Mar 28, 2016

@mcactive and @kcharwood Thanks! 👍 I put a comment over in #3945, it appears we won't be able to bump our min version because that would put fastlane in conflict with cocoapods 0.39 which is still working ok for Xcode 7.2 users. Eek. I'd like to close this and track it in the other issue if that sounds right to you folks.

@TKBurner
Copy link

@kcharwood I'm closing this issue out so we can track on the other ticket. Thanks for working with us!

@StrangeDays
Copy link

StrangeDays commented May 27, 2016

You can put the Fastfile in a subdir => Dir_where_xcodeproj/Fastlane/Fastfile

Due other error I have removed increment_build_number, using now a private lane 'update_build_number'
update_build_number sets the build number to the commit count of "master"

  private_lane :update_build_number do 
    build_number = :get_release_build_number
    `agvtool new-version -all #{build_number}`
  end

  private_lane :get_release_build_number do    
    build_number =  `git rev-list --count master..`
    build_number
  end

@fastlane fastlane locked and limited conversation to collaborators Nov 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants