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

Couldn't find config keyfile at path 'drive_key.json' #37

Open
KevinJ1008 opened this issue Sep 12, 2024 · 1 comment
Open

Couldn't find config keyfile at path 'drive_key.json' #37

KevinJ1008 opened this issue Sep 12, 2024 · 1 comment

Comments

@KevinJ1008
Copy link

KevinJ1008 commented Sep 12, 2024

No matter where drive_key.json file I place, the plugin always throw file not exist error to me, when I use this plugin in Flutter project

  desc "Run Android debug build"
  lane :debug_build do
    Dir.chdir "../.." do
      sh("flutter", "packages", "get")
      sh("flutter", "clean")
      sh("flutter", "build", "apk", "--debug", "-t", "lib/main_stag.dart", "--flavor", "stag", "-v")
      ENV["DEBUG_APK_PATH"] = sh("find", ".", "-name", "debug*.apk").strip
      puts ENV["DEBUG_APK_PATH"]
    end
  end

  desc "Build a new Android debug App to Dropbox"
  lane :dev_deploy do
    debug_build
    // I place `drive_key.json` in root project
    Dir.chdir "../.." do
      upload_to_google_drive(
        drive_keyfile: 'drive_key.json',
        service_account: true,
        folder_id: 'GOOGLE_DRIVE_FOLDER_ID',
        upload_files: [ENV["DEBUG_APK_PATH"]]
      )
    end

    // Same error below if I don't run in root
    upload_to_google_drive(
      drive_keyfile: '../android/fastlane/drive_key.json',
      service_account: true,
      folder_id: 'GOOGLE_DRIVE_FOLDER_ID',
      upload_files: [ENV["DEBUG_APK_PATH"]]
    )
  end

image

@bskim45
Copy link
Owner

bskim45 commented Sep 16, 2024

Can you share your project structure?
You can also refer to the official documentation about chdir: https://docs.fastlane.tools/advanced/fastlane/#directory-behavior

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

No branches or pull requests

2 participants