rubiconba / fastlane-plugin-flutter-version-manager

Fastlane plugin that is used to manage app versioning of Flutter project
MIT License
35 stars 11 forks source link

path does not exist #8

Closed talbiislam96 closed 2 years ago

talbiislam96 commented 2 years ago

I've tried to run the plugin on local , it doesn't work gives me this error :


wecraft@Mac-mini-de-Wecraft android % bundle exec fastlane bump_minor 
[✔] 🚀 
+-----------------------------------------+---------+-------------------------+
|                                Used plugins                                 |
+-----------------------------------------+---------+-------------------------+
| Plugin                                  | Version | Action                  |
+-----------------------------------------+---------+-------------------------+
| fastlane-plugin-flutter_version_manager | 1.0.0   | flutter_version_manager |
+-----------------------------------------+---------+-------------------------+

objc[3718]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7ad8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac02c8). One of the two will be used. Which one is undefined.
objc[3718]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7b28) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac0318). One of the two will be used. Which one is undefined.
[11:43:33]: ------------------------------
[11:43:33]: --- Step: default_platform ---
[11:43:33]: ------------------------------
[11:43:33]: Driving the lane 'bump_minor' 🚀
[11:43:33]: -------------------------------------
[11:43:33]: --- Step: flutter_version_manager ---
[11:43:33]: -------------------------------------
+------------------+------------+
|         Lane Context          |
+------------------+------------+
| DEFAULT_PLATFORM | android    |
| PLATFORM_NAME    |            |
| LANE_NAME        | bump_minor |
+------------------+------------+
[11:43:33]: path does not exist

+------+-------------------------+-------------+
|               fastlane summary               |
+------+-------------------------+-------------+
| Step | Action                  | Time (in s) |
+------+-------------------------+-------------+
| 1    | default_platform        | 0           |
| 💥   | flutter_version_manager | 0           |
+------+-------------------------+-------------+

[11:43:33]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️  The resource 'resetRatingsRequests' does not exist 
    https://github.com/fastlane/fastlane/issues/20098 [open] 4 💬
    2 weeks ago

➡️  Build number: xyz does not exist
    https://github.com/fastlane/fastlane/issues/19983 [open] 1 💬
    3 weeks ago

➡️  Build number: xx.yy does not exist
    https://github.com/fastlane/fastlane/issues/19840 [open] 4 💬
    3 weeks ago

Which path is it referring to ? and whether I should keep trying to fix the issues am getting will this work for me ? This is a very useful plugin but there's no documentation @davormaricdev , can you please help me on how to fix the errors am getting locally and how tp run the lanes through GitLab CI please I've been stuck

davormaricdev commented 2 years ago

Hi @talbiislam96 This plugin requires you to provide arguments that are described in the README file of this project. You can find an example of Fastfile here. Make sure that the fastlane is setup properly on your local machine before trying to apply the changes on CI/CD. Refer to Fastlane - How it works for more info on Fastlane and the core principles behind it.

davormaricdev commented 2 years ago

Additionally, refer to this blog post that tackles some of the approaches of this plugin

talbiislam96 commented 2 years ago

@davormaricdev here's my fast file :

# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
def versionString()
  file=YAML.load_file('../version.yml')
  version="#{file['major']}.#{file['minor']}.#{file['patch']}"
  UI.message version
  return version
end

default_platform(:android)

platform :android do
  desc "Runs all the tests"
  lane :test do
    gradle(task: "test")
  end

  desc "Build"
  lane :build do
    gradle(task: "clean assembleRelease")
  end

  desc "Deploy a new version to the Google Play"
  lane :deploy do
    gradle(task: "clean assembleRelease")
    upload_to_play_store
  end
end

lane :bump_major do
  flutter_version_manager(
    arguments: "-major",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml",
    git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile")
end

lane :bump_minor do
  flutter_version_manager(
    arguments: "-minor",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml")
end

lane :bump_patch do
  flutter_version_manager(
    arguments: "-patch",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml")
end

lane :read_version do
  flutter_version_manager(
    arguments: "-version",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml",
    git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile")
    commit_version_bump(
      message: 'Build Version Bump by fastlane',
      force: true
    )

    version = versionString()
    add_git_tag(tag: "App-#{version}")

    push_to_git_remote

end

lane :read_code do
  flutter_version_manager(
    arguments: "-code",
    yml: "./version.yml",
    pubspec: "./pubspec.yaml",
    git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile" )
end

lane :apply_new_version do
  flutter_version_manager(
    arguments: "-apply",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml",
    git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile")
end

lane :get_help do
  flutter_version_manager(
    arguments: "-h",
    yml: "../version.yml",
    pubspec: "../pubspec.yaml",
    git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile")
end

I followed the steps mentioned here on GitHub but still it tells mer that the path does not exist and I don't know which path it's talking about

talbiislam96 commented 2 years ago

@davormaricdev here's the stack trace

` wecraft@Mac-mini-de-Wecraft android % bundle exec fastlane bump_minor [✔] 🚀 +-----------------------------------------+---------+-------------------------+ | Used plugins | +-----------------------------------------+---------+-------------------------+ | Plugin | Version | Action | +-----------------------------------------+---------+-------------------------+ | fastlane-plugin-flutter_version_manager | 1.0.0 | flutter_version_manager | +-----------------------------------------+---------+-------------------------+

objc[3718]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7ad8) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac02c8). One of the two will be used. Which one is undefined. objc[3718]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x1ee7c7b28) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x10cac0318). One of the two will be used. Which one is undefined.

11:43:33: --- Step: default_platform ---

11:43:33: Driving the lane 'bump_minor' 🚀

11:43:33: --- Step: flutter_version_manager ---

+------------------+------------+ | Lane Context | +------------------+------------+ | DEFAULT_PLATFORM | android | | PLATFORM_NAME | | | LANE_NAME | bump_minor | +------------------+------------+ 11:43:33: path does not exist

+------+-------------------------+-------------+ | fastlane summary | +------+-------------------------+-------------+ | Step | Action | Time (in s) | +------+-------------------------+-------------+ | 1 | default_platform | 0 | | 💥 | flutter_version_manager | 0 | +------+-------------------------+-------------+

11:43:33: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️ The resource 'resetRatingsRequests' does not exist https://github.com/fastlane/fastlane/issues/20098 [open] 4 💬 2 weeks ago

➡️ Build number: xyz does not exist https://github.com/fastlane/fastlane/issues/19983 [open] 1 💬 3 weeks ago

➡️ Build number: xx.yy does not exist https://github.com/fastlane/fastlane/issues/19840 [open] 4 💬 3 weeks ago

`

davormaricdev commented 2 years ago

Can you share yours Pluginfile and Fastfile @talbiislam96 ?

talbiislam96 commented 2 years ago

fastfile :

` def versionString() file=YAML.load_file('../version.yml') version="#{file['major']}.#{file['minor']}.#{file['patch']}" UI.message version return version end

default_platform(:android)

platform :android do desc "Runs all the tests" lane :test do gradle(task: "test") end

desc "Build" lane :build do gradle(task: "clean assembleRelease") end

desc "Deploy a new version to the Google Play" lane :deploy do gradle(task: "clean assembleRelease") upload_to_play_store end end

lane :bump_major do flutter_version_manager( arguments: "-major", yml: "../version.yml", pubspec: "../pubspec.yaml", git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile") end

lane :bump_minor do flutter_version_manager( arguments: "-minor", yml: "../version.yml", pubspec: "../pubspec.yaml") end

lane :bump_patch do flutter_version_manager( arguments: "-patch", yml: "../version.yml", pubspec: "../pubspec.yaml") end

lane :read_version do flutter_version_manager( arguments: "-version", yml: "../version.yml", pubspec: "../pubspec.yaml", git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile") commit_version_bump( message: 'Build Version Bump by fastlane', force: true )

version = versionString()
add_git_tag(tag: "App-#{version}")

push_to_git_remote

end

lane :read_code do flutter_version_manager( arguments: "-code", yml: "./version.yml", pubspec: "./pubspec.yaml", git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile" ) end

lane :apply_new_version do flutter_version_manager( arguments: "-apply", yml: "../version.yml", pubspec: "../pubspec.yaml", git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile") end

lane :get_help do flutter_version_manager( arguments: "-h", yml: "../version.yml", pubspec: "../pubspec.yaml", git_repo: "https://gitlab.com/wecraft.tn/projects/xenon/front/app-mobile") end

` plugin :

`

gem 'fastlane-plugin-flutter_version_manager' gem 'git'

` Git plugin is configured I even added my git repo link as a param

davormaricdev commented 2 years ago

@talbiislam96 path to git_repo is wrong. It should refer to .git directory that is accessible to file system. git_repo argument is optional and it defaults to ./.

What is the .git folder?

davormaricdev commented 2 years ago

Alternatively, path to yml files might also be wrong. You can read more about how fastlane handles directories here.

davormaricdev commented 2 years ago

@davormaricdev I don't get it which folder is supposed to contain .git ? I've got just .gitignore file ?

@talbiislam96 please refer to stackoverflow link I provided before

davormaricdev commented 2 years ago

If you've cloned git repository, then you have .git folder. Bear in mind that .git folder is hidden by default. Also, please note that, as stated in README, this plugin heavily resides on having a git repository.

I will close this issue now as this is an issue with how your git repository is maintained. Best of luck!

talbiislam96 commented 2 years ago

@davormaricdev thank you so much for your help it worked , but the version was : 1.0.0+2 when I applied bump-patch it became like this : 0.0.2+51144791 , this is not what I want to happen I want to keep the build number (after the plus sign ) also keep the major /minor only bump patch !