Error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found

Viewed 7227

laravel Framework is 7.9.2.

composer require league/flysystem-aws-s3-v3 ~1.0 installed to use aws s3.

It runs on localhost, but when I put it on the aws server,

Error: Class 'League\Flysystem\AwsS3v3\AwsS3Adapter' not found error appears.

However, when I checked with composer licenses,

It is identified as league/flysystem v1.0.67 MIT.

I don't know what the problem is. If you have any difficulties like me, please help me.

5 Answers

This probably isn't going to help you, but I stumbled across this looking for a solution to the same error. It looks like the League S3 AWS V3 adapter had an upgrade and the version 2 branch doesn't use the same class names. I specified the version I wanted like this in composer.json and that seemed to sort it out:

    "league/flysystem-aws-s3-v3": "1.0.29",

Maybe you should try run this command in terminal

composer require league/flysystem-aws-s3-v3 ^1.0

I had this problem... it may not apply to you...

I still got the problem after

composer require league/flysystem-aws-s3-v3

The reason being is since Oct2020 the class was renamed from

AwsS3Adapter to AwsS3V3Adapter

It is due to the composer.lock file which has league/flysystem-aws-s3-v2.

something like :

"league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2" ( the problem)

"league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3",

Solution

Simple run composer require league/flysystem-aws-s3-v3

Laravel 8

install with --update-with-all-dependencies flag

composer require league/flysystem-aws-s3-v3 "~1.0" --update-with-all-dependencies
Related