Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda