Fastlane & Flutter - Google Api Error: Invalid request - Access Not Configured. Google Play

2,366
desc "Deploy a new beta build to Google Play"
   lane :beta do
     build_number = number_of_commits()
     Dir.chdir "../.." do
       sh("flutter", "packages", "get")
       sh("flutter", "clean")
       sh("flutter", "build", "appbundle", "--build-number=#{build_number}")
     end
      upload_to_play_store(track: 'beta', aab: '../build/app/outputs/bundle/release/app-release.aab')
   end
Share:
2,366
Lutaaya Huzaifah Idris
Author by

Lutaaya Huzaifah Idris

I am Lutaaya Huzaifah Idris , a Core Experienced Mobile developer , I graduated at Islamic University in Uganda while offering Bachelors of Science in Computer Science. I love to keep the code in the air. If you need any mobile software just send me a hello and we communicate.

Updated on December 21, 2022

Comments

  • Lutaaya Huzaifah Idris
    Lutaaya Huzaifah Idris over 1 year

    What causes this error when using Fastlane and Flutter after running this :

    bundle exec fastlane beta

    Google Api Error: Invalid request - Access Not Configured. Google Play Developer API has not been used in project before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/androidpublisher.googleapis.com/overview?project=xxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.

    When the Service Account is enabled and linked to the Play Store account with Release Manager, I read different conversations on github, but I couldnt get clear answers, I tried to increase the version of my APK since I uploaded one, but no luck.

    This is my code in the Fastfile :

    update_fastlane
    
    default_platform(:android)
    
    platform :android do
      desc "Runs all the tests"
      lane :test do
        gradle(task: "test")
      end
    
      desc "Deploy an beta new version to the Google Play"
      lane :beta do
           gradle(
               task: 'assemble',
               build_type: 'Release'
             )
         upload_to_play_store(track: 'beta',
         version_code: 5,
         aab: '../build/app/outputs/bundle/release/app-release.aab',
         )
       end
    end
    

    Then also it says somewhere, that :

    [11:16:18]: Couldn't find any new signed apk files...
    

    yet I provided the path to the aab.

    Anyone who can quickly unblock me please

  • Lutaaya Huzaifah Idris
    Lutaaya Huzaifah Idris almost 4 years
    Changed it but still same error, is there anything I have missed ?
  • Lutaaya Huzaifah Idris
    Lutaaya Huzaifah Idris almost 4 years
    Actually I don't know if this code implies to the aab or apk only ?
  • rcarba
    rcarba almost 4 years
    For the error it seems like it is searching for the apk, even you ask for the aab, but I notice there's a comma at the end of the line and there are more parameters after. Could you try to remove it?
  • Lutaaya Huzaifah Idris
    Lutaaya Huzaifah Idris almost 4 years
    I have removed it, but still the same issue, I don't if you can accept and we have like a short call on google meet
  • humblePilgrim
    humblePilgrim about 3 years
    @LutaayaHuzaifahIdris did you find a solution for this ?
  • Lutaaya Huzaifah Idris
    Lutaaya Huzaifah Idris about 3 years
    @humblePilgrim, no I didn't