3

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.

jekim
  • 41
  • 1
  • 1
  • 4

6 Answers6

7

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",
Dave Child
  • 7,573
  • 2
  • 25
  • 37
3

Maybe you should try run this command in terminal

composer require league/flysystem-aws-s3-v3 ^1.0
  • 1
    For those on Laravel 9, you'll need to upgrade to v3.0 instead. composer require -W league/flysystem-aws-s3-v3 "^3.0" – Jeff C. May 01 '22 at 20:58
2

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

MistaJase
  • 839
  • 7
  • 12
  • Got Error: - league/flysystem-aws-s3-v3[2.1.0, ..., 2.x-dev] require league/flysystem ^2.0.0 -> found league/flysystem[2.0.0-alpha.1, ..., 2.x-dev] but the package is fixed to 1.1.9 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires league/flysystem-aws-s3-v3 ^2.1 -> satisfiable by league/flysystem-aws-s3-v3[2.1.0, 2.x-dev]. – Imran_Developer Dec 15 '21 at 11:34
  • If you are using a newer version of laravel, its one of the require dev options but not installed by default. You can see it in the suggestions: "suggest": { ..., "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^3.0).", ...} – Adsy2010 Jun 14 '23 at 11:59
1

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

PHPer
  • 637
  • 4
  • 19
  • Got Error: - league/flysystem-aws-s3-v3[2.1.0, ..., 2.x-dev] require league/flysystem ^2.0.0 -> found league/flysystem[2.0.0-alpha.1, ..., 2.x-dev] but the package is fixed to 1.1.9 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command. - Root composer.json requires league/flysystem-aws-s3-v3 ^2.1 -> satisfiable by league/flysystem-aws-s3-v3[2.1.0, 2.x-dev]. – Imran_Developer Dec 15 '21 at 11:35
1

Laravel 8

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

composer require league/flysystem-aws-s3-v3 "~1.0" --update-with-all-dependencies
Akash Kumar Verma
  • 3,185
  • 2
  • 16
  • 32
  • how do we install in laravel 9? it says, laravel 9 is only compatible with league/flysystem-aws-s3-v3:3.0 – amit Nov 04 '22 at 08:04
0

I was also getting same error when I have upgraded to lumen 10 from lumen 6 and version of flysystem and flysystem-aws-s3-v3

"league/flysystem": "3.10",
"league/flysystem-aws-s3-v3": "^3.15",

to resolve this error I have to change code from

 $client = $storage->getAdapter()->getClient();

to this

$client = $storage->getClient();