Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

93
Views
App crash on firestick 2nd gen when getting presigned URL

Gradle

implementation platform('software.amazon.awssdk:bom:2.17.119')
implementation 'software.amazon.awssdk:s3'

Code Used To get Presigned Url

public static URL getPresignedUrl(String bucketName, String keyName ) {
    PresignedGetObjectRequest presignedGetObjectRequest = null;
    try {
        AwsCredentialsProvider credentialsProvider = StaticCredentialsProvider.create
                (AwsBasicCredentials.create(Access Key, Secret Key));


        S3Presigner preSigner = S3Presigner.builder()
                .credentialsProvider(credentialsProvider)
                .region(Region.US_WEST_2).build();
        GetObjectRequest getObjectRequest =
                GetObjectRequest.builder()
                        .bucket(bucketName)
                        .key(keyName)
                        .build();

        GetObjectPresignRequest getObjectPresignRequest = null;
        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
            getObjectPresignRequest = GetObjectPresignRequest.builder()
                    .signatureDuration(Duration.ofDays(1))
                    .getObjectRequest(getObjectRequest)
                    .build();
        }

        // Generate the presigned request
         presignedGetObjectRequest =
                 preSigner.presignGetObject(getObjectPresignRequest);
    } catch (Exception e) {
        e.getStackTrace();
    }
    return  presignedGetObjectRequest.url();
}

App working fine if the fire OS version is greater than or equal 7.x.x Crashes on fire OS version 5.x.x

Crashing on the line S3Presigner preSigner = S3Presigner.builder()

Crash Log

Need help

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Without exact knowledge about the versions it's hard to spot the reason directly.

But you can try it by yourself by separating the concatenated statements:
Currently:

        S3Presigner preSigner = S3Presigner.builder()
                .credentialsProvider(credentialsProvider)
                .region(Region.US_WEST_2).build();

New:

        S3Presigner preSigner = S3Presigner.builder();
        preSigner = preSigner.credentialsProvider(credentialsProvider);
        preSigner = preSigner.region(Region.US_WEST_2):
        preSigner = preSigner.build();

I'm neither firm with Java nor with the Fire OS API, so it's quite possible that my code wouldn't work even on the never Fire OS versions and you had to change a bit.
Nevertheless I think you can get the idea to disentangle all statements to see which part of causing the problem.
After knowing this you can look if the corresponding function is perhaps missing in Fire OS 5 or if you have to change the parameters perhaps.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!