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

Unknown method 'version_file_names' #96

Closed
tabrindle opened this issue Mar 25, 2021 · 6 comments · Fixed by #99
Closed

Unknown method 'version_file_names' #96

tabrindle opened this issue Mar 25, 2021 · 6 comments · Fixed by #99

Comments

@tabrindle
Copy link

tabrindle commented Mar 25, 2021

Error throws - upload of artifact and html successful, but fails the rest of the process because of the version file.

[18:56:50]: Cruising over to lane 'android upload' 🚖
[18:56:50]: --------------------
[18:56:50]: --- Step: aws_s3 ---
[18:56:50]: --------------------
[18:56:53]: Unknown method 'version_file_names'

Using like this:

lane :upload do
  aws_s3(
    access_key: ENV["S3_ACCESS_KEY"],
    secret_access_key: ENV["S3_SECRET_ACCESS_KEY"],
    bucket: "mobile-apps",
    region: "us-west-2",
    app_directory: "asdf",
    upload_metadata: true,
  )
end

May be related to the 2.0.0 upgrade. https://github.com/fastlane-community/fastlane-plugin-s3/pull/51/files

EDIT: adding upload_metadata: false, seems to be a temporary workaround as it returns in that function early, but I'd like to use the version.json and html.

Attached is the fastlane env:

✅ fastlane environment ✅

Stack

Key Value
OS 10.15.7
Ruby 2.7.2
Bundler? true
Git git version 2.30.1
Installation Source /usr/local/lib/ruby/gems/2.7.0/bin/fastlane
Host Mac OS X 10.15.7 (19H524)
Ruby Lib Dir /usr/local/Cellar/[email protected]/2.7.2/lib
OpenSSL Version OpenSSL 1.1.1i 8 Dec 2020
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 12.4

System Locale

Variable Value
LANG en_US.UTF-8
LC_ALL
LANGUAGE

fastlane files:

`./fastlane/Fastfile`
package = load_json(json_path: "package.json")
version = package["version"]
build = ENV.has_key?("GITHUB_RUN_NUMBER") ? ENV["GITHUB_RUN_NUMBER"] : 1

lane :upload do
  aws_s3(
    access_key: ENV["S3_ACCESS_KEY"],
    secret_access_key: ENV["S3_SECRET_ACCESS_KEY"],
    bucket: "mobile-apps",
    region: "us-west-2",
    app_directory: "asdf",
    upload_metadata: true,
  )
end

platform :android do
  desc "Build Android app"
  lane :build do
    skip_docs
    gradle(
      task: "clean assembleRelease",
      project_dir: "android",
      system_properties: {
        "BASE_NAME" => "v#{version}-#{build}",
        "VERSION_CODE" => build,
        "VERSION_NAME" => version,
      },
    )
    on_success("Android")
    if ENV["S3_ACCESS_KEY"] && ENV["S3_SECRET_ACCESS_KEY"]
      upload
    end
  end
  error do |lane, exception|
    on_error("Android", lane, exception)
  end
end

platform :ios do
  desc "Build iOS app"
  lane :build do
    skip_docs
    clean_build_artifacts
    clear_derived_data
    if is_ci
      create_keychain(
        name: "fastlane-asdf",
        unlock: false,
        timeout: false,
      )
      match(
        type: "enterprise",
        git_url: "https://github.com/asdf/ios-codesigning",
        git_branch: "latest",
        git_basic_authorization: Base64.strict_encode64(ENV["FASTLANE_CODESIGNING_REPO_TOKEN"]),
        readonly: true,
        keychain_name: "fastlane-asdf",
      )
    else
      match(
        type: "enterprise",
        git_url: "https://github.com/asdf/ios-codesigning",
        git_branch: "latest",
        readonly: true,
        verbose: true,
      )
    end
    increment_version_number(
      version_number: version,
      xcodeproj: "ios/asdf.xcodeproj",
    )
    increment_build_number(
      build_number: build,
      skip_info_plist: true,
      xcodeproj: "ios/asdf.xcodeproj",
    )
    update_project_provisioning(
      target_filter: "asdf",
      profile: ENV["sigh_com.asdf.asdf_enterprise_profile-path"],
      build_configuration: "Release",
      xcodeproj: "ios/asdf.xcodeproj",
    )
    build_app(
      clean: true,
      silent: true,
      export_method: "enterprise",
      export_options: {
        provisioningProfiles: {
          "com.asdf.asdf" => ENV["sigh_com.asdf.asdf_enterprise_profile-name"],
        },
      },
      output_name: "v#{version}-#{build}.ipa",
      scheme: "asdf",
      workspace: "ios/asdf.xcworkspace",
    )
    on_success("iOS")
    if is_ci && ENV["S3_ACCESS_KEY"] && ENV["S3_SECRET_ACCESS_KEY"]
      upload
    end
  end
  error do |lane, exception|
    on_error("iOS", lane, exception)
  end
end

def on_success(platform)
  slack(
    message: "asdf- #{platform} Build Successful",
    default_payloads: [:git_branch, :git_author, :last_git_commit, :last_git_commit_hash],
    attachment_properties: {
      fields: [{
        title: "Details",
        value: "https://github.com/#{ENV["GITHUB_REPOSITORY"]}/actions/runs/#{ENV["GITHUB_RUN_ID"]}",
      }],
    },
  )
end

def on_error(platform, lane, exception)
  slack(
    message: "asdf - #{platform} Build Failed",
    success: false,
    default_payloads: [:git_branch, :git_author, :last_git_commit, :last_git_commit_hash],
    attachment_properties: {
      fields: [{
        title: "Details",
        value: "https://github.com/#{ENV["GITHUB_REPOSITORY"]}/actions/runs/#{ENV["GITHUB_RUN_ID"]}",
      }],
    },
  )
end
`./fastlane/Appfile`
app_identifier("com.asdf.asdf")
itc_team_id("12312312")
package_name("com.asdf.asdf")
team_id("123123112313")

fastlane gems

Gem Version Update-Status
fastlane 2.178.0 ✅ Up-To-Date

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-aws_s3 2.0.0 ✅ Up-To-Date
fastlane-plugin-load_json 0.0.1 ✅ Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.4.0
bundler 2.1.4
uri 0.10.0
rake 13.0.3
CFPropertyList 3.0.3
public_suffix 4.0.6
addressable 2.7.0
rubyzip 2.3.0
apktools 0.7.4
artifactory 3.0.15
atomos 0.1.3
aws-eventstream 1.1.1
aws-partitions 1.434.0
aws-sigv4 1.2.3
jmespath 1.4.0
aws-sdk-core 3.113.0
aws-sdk-kms 1.43.0
aws-sdk-s3 1.93.0
babosa 1.0.4
claide 1.0.3
colored 1.2
colored2 3.1.2
highline 1.7.10
commander-fastlane 4.4.6
declarative 0.0.20
declarative-option 0.1.0
digest-crc 0.6.3
unf_ext 0.0.7.7
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.7.6
emoji_regex 3.2.2
excon 0.79.0
faraday-net_http 1.0.1
multipart-post 2.0.0
ruby2_keywords 0.0.4
faraday 1.3.0
http-cookie 1.0.3
faraday-cookie_jar 0.0.7
faraday_middleware 1.0.0
fastimage 2.2.3
gh_inspector 1.1.3
jwt 2.2.2
memoist 0.16.2
multi_json 1.15.0
os 1.1.1
signet 0.15.0
googleauth 0.16.0
httpclient 2.8.3
mini_mime 1.0.2
uber 0.1.0
representable 3.0.4
retriable 3.1.2
google-api-client 0.38.0
rexml 3.2.4
webrick 1.7.0
google-apis-core 0.3.0
google-apis-iamcredentials_v1 0.2.0
google-apis-storage_v1 0.3.0
google-cloud-env 1.5.0
google-cloud-errors 1.1.0
google-cloud-core 1.6.0
google-cloud-storage 1.31.0
json 2.5.1
mini_magick 4.11.0
naturally 2.2.1
plist 3.6.0
security 0.1.3
simctl 1.6.8
slack-notifier 2.3.2
terminal-notifier 2.0.0
unicode-display_width 1.7.0
terminal-table 1.8.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.19.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
mime-types-data 3.2021.0225
mime-types 3.3.1
fastlane-plugin-aws_s3 2.0.0
fastlane-plugin-load_json 0.0.1

generated on: 2021-03-25

@sebalopez
Copy link

Seeing the same issue here. Using 2.0.0 version with fastlane 2.179.0 on ubuntu

@yejunyiDadi
Copy link

yejunyiDadi commented Mar 29, 2021

I also encountered the same problem in Travis-ci.

[17:37:27]: --------------------
[17:37:27]: --- Step: aws_s3 ---
[17:37:27]: --------------------
[17:37:33]: Unknown method 'version_file_names'
[17:37:33]: To call another action from an action use `other_action.version_file_names` instead

vsersion: 2.0.0

@VinhShin
Copy link

I faced the same issue with Fastlane 2.179.0 in Big Sur

@redlabrat
Copy link

redlabrat commented Mar 31, 2021

Faced same error for android build upload. For iOS build upload for the same AWS server this plugin worked correctly (version 2.0.0).
Android uploads to: "...s3.amazonaws.com/builds/beta/android/223_0.8.7/app-beta-release.apk"
"...s3.amazonaws.com/builds/beta/android/index.html'"
iOS uploads to: "...s3.amazonaws.com/builds/beta/ios/v0.8.8_b268/app_name.ipa"
"...s3.amazonaws.com/builds/beta/ios/index.html"

@tabrindle
Copy link
Author

Thanks!

@joshdholtz
Copy link
Member

@tabrindle You’re welcome! Sorry for introducing the error in the first place 😅 This is released now in 2.0.2 💪

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

Successfully merging a pull request may close this issue.

6 participants