1

Currently I cannot get a file downloaded from my AWS S3 bucket into my android studio app. I am using amplify client to do this.

I tried to test the app on a physical device, however it crashed as soon as I tested it. Here is the code

public void downloadFiles(){
        Amplify.Storage.downloadFile(
                "test.txt",
                new File(getApplicationContext().getFilesDir() + "/download.txt"),
                StorageDownloadFileOptions.defaultInstance(),
                progress -> Log.i("MyAmplifyApp", "Fraction completed: " + progress.getFractionCompleted()),
                result -> Log.i("MyAmplifyApp", "Successfully downloaded: " + result.getFile().getName()),
                error -> Log.e("MyAmplifyApp",  "Download Failure", error)
        );
    }
xgyu
  • 11
  • 2
  • `It crashed` and? What was the error message produced? That stack trace should point you exactly at the error. – Matt Clark Jun 29 '23 at 23:41
  • Caused by: java.lang.IllegalStateException: Tried to get a plugin but that plugin was not present. Check if the plugin was added originally or perhaps was already removed. at com.amplifyframework.core.category.Category.getPluginIfConfiguredOrThrow(Category.java:220). I am not sure what this means or how to fix it. – xgyu Jul 01 '23 at 01:26

0 Answers0