Coder Social home page Coder Social logo

Comments (10)

ivan901229 avatar ivan901229 commented on May 3, 2024 4

My code closely resembles yours.

    ## Initialize the latest_internal_build_number with a default value of 0
    latest_internal_build_number = 0
    ## Attempt to fetch the internal test build numbers. If target track is not created, then an error appeared.
    begin
      latest_internal_build_numbers = google_play_track_version_codes(
        package_name: ENV['BUNDLE_ID'],
        track: "internal"
      )
      # Update the latest version number if successfully retrieved
      latest_internal_build_number = latest_internal_build_numbers.max unless latest_internal_build_numbers.empty?
    rescue StandardError => e
      puts "An error occurred: #{e.message} while fetching the latest internal build number"
    end
    options[:latest_internal_build_number] = latest_internal_build_number.to_s

As you mentioned, the fundamental solution should be to fix client.rb.

from fastlane.

burak-pensa avatar burak-pensa commented on May 3, 2024 1

@trinitiwowka I saw another PR almost related to this one, still awaiting review. The best possible solution for now is to try catching a StandardError as @ivan901229 mentioned and continue.

def self.latest_build_number
	tracks = ["internal", "alpha", "beta", "production"]
	version_codes = []
	tracks.each do |track|
		begin
			vc =  google_play_track_version_codes(track: track)
		rescue 
			puts  "No track found for " + track
		else
			version_codes.concat(vc)
		end
	end
	version_codes.max
end

from fastlane.

trinitiwowka avatar trinitiwowka commented on May 3, 2024

Constant problems with this code to determine the version.
If such a "track" is not created, then an error appeared.

I found solution with this code, and it worked:

    lane :get_google_play_track_version_codes do |options|
      track_version_codes = [0]
      begin
        track_version_codes = google_play_track_version_codes(
          package_name: options[:package_name],
          track: options[:track],
          json_key: options[:json_key],
        )
      rescue => gptvcError
        if (gptvcError.class != Google::Apis::ClientError || gptvcError.status_code != 404)
          raise gptvcError
        end
      end
      track_version_codes
    end

But now the error is completely different. and it is reproduced in both 2.213.0 and 2.214.0

from fastlane.

StanislavARA avatar StanislavARA commented on May 3, 2024

this worked for me:

lane :get_google_play_track_version_codes do |options|
    track_version_codes = []
    track_version_codes
end

from fastlane.

trinitiwowka avatar trinitiwowka commented on May 3, 2024

But my solution worked perfectly for almost a year. and a couple broke in all my projects a few days ago.

from fastlane.

trinitiwowka avatar trinitiwowka commented on May 3, 2024

I found solution. In this line

return result.releases.flat_map(&:version_codes) || []

just add

        releases = result.releases || []
        return releases.flat_map(&:version_codes) || []

from fastlane.

ivan901229 avatar ivan901229 commented on May 3, 2024

I'm encountering the same issue as well and currently using a begin-rescue-end block to handle error.

from fastlane.

trinitiwowka avatar trinitiwowka commented on May 3, 2024

I'm encountering the same issue as well and currently using a begin-rescue-end block to handle error.

can you show example please?

from fastlane.

burak-pensa avatar burak-pensa commented on May 3, 2024

@joshdholtz Hey guys, any progress on this?

from fastlane.

danielesegato avatar danielesegato commented on May 3, 2024

Hi I have this problem and it happens when the track version is configured like this:
Screenshot 2023-10-12 at 10 23 22

When requesting beta in this situation you get the error above.

I've verified this in last version: 2.216.0

from fastlane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.