kreait / laravel-firebase

A Laravel package for the Firebase PHP Admin SDK

Home Page:https://github.com/kreait/firebase-php

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getting lot of issue during installation

sv0k opened this issue · comments

commented

Hello,

I saw the last issue topic about lot of errors during the installation and I got almost the same error... but the solution to remove vendor directory and clean composer.lock not work for me. Can you help me for the installation please ?

To begin, this is my composer.json file :

{
"name": "keenthemes/metronic-laravel",
"type": "project",
"description": "The Metronic in the Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"anlutro/l4-settings": "^1.0",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"jackiedo/log-reader": "^2.1",
"laravel/framework": "^8.12",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.5",
"spatie/laravel-activitylog": "^4.0",
"spatie/laravel-permission": "^4.0",
"yajra/laravel-datatables-buttons": "^4.10",
"yajra/laravel-datatables-oracle": "~9.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.9",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.0",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3",
"roave/security-advisories": "dev-latest"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"files": [
"app/helpers.php"
],
"psr-4": {
"App\": "app/",
"Database\Factories\": "database/factories/",
"Database\Seeders\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\Foundation\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r "file_exists('.env') || copy('.env.example', '.env');""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
],
"post-update-cmd": [
"Illuminate\Foundation\ComposerScripts::postUpdate",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta"
]
}
}

What I did : composer require kreait/laravel-firebase

I got this errors :

Using version ^3.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer update kreait/laravel-firebase
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- kreait/laravel-firebase 3.x-dev is an alias of kreait/laravel-firebase dev-main and thus requires it to be installed too.
- kreait/laravel-firebase 3.1.0 requires kreait/firebase-php ^5.14.1 -> satisfiable by kreait/firebase-php[5.14.1, ..., 5.x-dev].
- kreait/laravel-firebase dev-main requires kreait/firebase-php ^5.18 -> satisfiable by kreait/firebase-php[5.18.0, ..., 5.x-dev].
- kreait/firebase-php[5.21.0, ..., 5.x-dev] require google/auth ^1.16 -> satisfiable by google/auth[v1.16.0].
- google/auth v1.16.0 requires guzzlehttp/psr7 ^1.2 -> found guzzlehttp/psr7[1.2.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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.
- kreait/firebase-php[5.14.1, ..., 5.20.1] require guzzlehttp/psr7 ^1.7 -> found guzzlehttp/psr7[1.7.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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 kreait/laravel-firebase ^3.1 -> satisfiable by kreait/laravel-firebase[3.1.0, 3.x-dev (alias of dev-main)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

So I did.... composer require kreait/laravel-firebase -W

and got others issues :

Problem 1
- Root composer.json requires laravel/framework ^8.12, found laravel/framework[v8.12.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 2
- anlutro/l4-settings is locked to version v1.0.0 and an update of this package was not requested.
- anlutro/l4-settings v1.0.0 requires illuminate/cache >=4.2 <9.0 -> found illuminate/cache[v4.2.0-BETA1, ..., 4.2.x-dev, v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 3
- jackiedo/log-reader is locked to version 2.1.8 and an update of this package was not requested.
- jackiedo/log-reader 2.1.8 requires illuminate/cache ^8.0|^7.0|^6.0|5.* -> found illuminate/cache[v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 4
- laravel/tinker is locked to version v2.6.1 and an update of this package was not requested.
- laravel/tinker v2.6.1 requires illuminate/console ^6.0|^7.0|^8.0 -> found illuminate/console[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 5
- spatie/laravel-activitylog is locked to version 4.0.0 and an update of this package was not requested.
- spatie/laravel-activitylog 4.0.0 requires illuminate/config ^8.0 -> found illuminate/config[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 6
- spatie/laravel-permission is locked to version 4.2.0 and an update of this package was not requested.
- spatie/laravel-permission 4.2.0 requires illuminate/auth ^6.0|^7.0|^8.0 -> found illuminate/auth[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 7
- yajra/laravel-datatables-buttons is locked to version v4.13.1 and an update of this package was not requested.
- yajra/laravel-datatables-buttons v4.13.1 requires illuminate/console * -> found illuminate/console[dev-master, v1.0.0, v1.1.0, v4.0.0-BETA2, ..., 4.2.x-dev, v5.0.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, 9.x-dev (alias of dev-master)] but these were not loaded, likely because it conflicts with another require.
Problem 8
- yajra/laravel-datatables-oracle is locked to version v9.18.1 and an update of this package was not requested.
- yajra/laravel-datatables-oracle v9.18.1 requires illuminate/database 5.8.*|^6|^7|^8 -> found illuminate/database[v5.8.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 9
- barryvdh/laravel-ide-helper is locked to version v2.10.0 and an update of this package was not requested.
- barryvdh/laravel-ide-helper v2.10.0 requires illuminate/console ^8 -> found illuminate/console[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 10
- laravel/breeze is locked to version v1.3.1 and an update of this package was not requested.
- laravel/breeze v1.3.1 requires illuminate/validation ^8.42 -> found illuminate/validation[v8.42.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
Problem 11
- laravel/sail is locked to version v1.8.6 and an update of this package was not requested.
- laravel/sail v1.8.6 requires illuminate/console ^8.0|^9.0 -> found illuminate/console[dev-master, v8.0.0, ..., 8.x-dev, 9.x-dev (alias of dev-master)] but these were not loaded, likely because it conflicts with another require.
Problem 12
- facade/flare-client-php 1.8.1 requires illuminate/pipeline ^5.5|^6.0|^7.0|^8.0 -> found illuminate/pipeline[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
- facade/ignition 2.11.2 requires facade/flare-client-php ^1.6 -> satisfiable by facade/flare-client-php[1.8.1].
- facade/ignition is locked to version 2.11.2 and an update of this package was not requested.

Thank you in advance for your help.

Best regards,

i have the same issues.

I can't see the PHP version requirement in your composer.json- which PHP version(s) are you using?

Have you done a composer update -W before requiring the Firebase package, to make sure that all dependencies are up to date?

A composer self-update might help as well, please make sure that you're using Composer 2.

@jeromegamez Trying on a fresh install of Laravel now with a few other packages installed:

  Problem 1
    - kreait/laravel-firebase 3.x-dev is an alias of kreait/laravel-firebase dev-main and thus requires it to be installed too.
    - kreait/laravel-firebase 3.1.0 requires kreait/firebase-php ^5.14.1 -> satisfiable by kreait/firebase-php[5.14.1, ..., 5.x-dev].
    - kreait/laravel-firebase dev-main requires kreait/firebase-php ^5.18 -> satisfiable by kreait/firebase-php[5.18.0, ..., 5.x-dev].
    - kreait/firebase-php[5.21.0, ..., 5.x-dev] require google/auth ^1.16 -> satisfiable by google/auth[v1.16.0].
    - google/auth v1.16.0 requires guzzlehttp/psr7 ^1.2 -> found guzzlehttp/psr7[1.2.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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.
    - kreait/firebase-php[5.14.1, ..., 5.20.1] require guzzlehttp/psr7 ^1.7 -> found guzzlehttp/psr7[1.7.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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 kreait/laravel-firebase ^3.1 -> satisfiable by kreait/laravel-firebase[3.1.0, 3.x-dev (alias of dev-main)].

Composer.json

"require": {
        "php": "^7.3|^8.0",
        "algolia/algoliasearch-client-php": "^3.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.40",
        "laravel/sanctum": "^2.11",
        "laravel/scout": "^9.2",
        "laravel/socialite": "^5.2",
        "laravel/tinker": "^2.5",
        "spatie/laravel-http-logger": "^1.7",
        "spatie/laravel-permission": "^4.2"
    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/sail": "^1.0.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },

Seems it conflicts with some of the laravel/socialite requirements for me and for laravel/sail for @sv0k above

Thank you for the details! It looks like some dependencies are locked in the composer.lock - perhaps a composer require --with-all-dependencies kreait/laravel-Firebase works.

Depending on the PHP version on your system, not the latest version of the underlying SDK will be installed - if you're on PHP >= 7.4 everything should be fine, though.

Once you can tell me the PHP version you're using, I will try to reproduce the problem.

composer require --with-all-dependencies kreait/laravel-Firebase
Using version ^3.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer update kreait/laravel-firebase --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires laravel/framework ^8.40, found laravel/framework[v8.40.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 2
    - laravel/sanctum is locked to version v2.11.2 and an update of this package was not requested.
    - laravel/sanctum v2.11.2 requires illuminate/database ^6.9|^7.0|^8.0 -> found illuminate/database[v6.10.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 3
    - laravel/scout is locked to version v9.2.3 and an update of this package was not requested.
    - laravel/scout v9.2.3 requires illuminate/bus ^8.0 -> found illuminate/bus[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 4
    - laravel/socialite is locked to version v5.2.3 and an update of this package was not requested.
    - laravel/socialite v5.2.3 requires illuminate/http ^6.0|^7.0|^8.0 -> found illuminate/http[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 5
    - laravel/tinker is locked to version v2.6.1 and an update of this package was not requested.
    - laravel/tinker v2.6.1 requires illuminate/console ^6.0|^7.0|^8.0 -> found illuminate/console[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 6
    - spatie/laravel-permission is locked to version 4.2.0 and an update of this package was not requested.
    - spatie/laravel-permission 4.2.0 requires illuminate/auth ^6.0|^7.0|^8.0 -> found illuminate/auth[v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
  Problem 7
    - laravel/sail is locked to version v1.8.6 and an update of this package was not requested.
    - laravel/sail v1.8.6 requires illuminate/console ^8.0|^9.0 -> found illuminate/console[dev-master, v8.0.0, ..., 8.x-dev, 9.x-dev (alias of dev-master)] but these were not loaded, likely because it conflicts with another require.
  Problem 8
    - facade/flare-client-php 1.8.1 requires illuminate/pipeline ^5.5|^6.0|^7.0|^8.0 -> found illuminate/pipeline[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - facade/ignition 2.11.2 requires facade/flare-client-php ^1.6 -> satisfiable by facade/flare-client-php[1.8.1].
    - facade/ignition is locked to version 2.11.2 and an update of this package was not requested.

PHP version

 php -v
PHP 8.0.6 (cli) (built: May 13 2021 05:36:01) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.6, Copyright (c), by Zend Technologies

I can confirm that I got the same errors when I tried to install the package in a fresh Laravel project:

$ laravel new issue-97
$ cd issue 97
$ composer require kreait/laravel-firebase
Using version ^3.1 for kreait/laravel-firebase
./composer.json has been updated
Running composer update kreait/laravel-firebase
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - kreait/laravel-firebase 3.x-dev is an alias of kreait/laravel-firebase dev-main and thus requires it to be installed too.
    - kreait/laravel-firebase 3.1.0 requires kreait/firebase-php ^5.14.1 -> satisfiable by kreait/firebase-php[5.14.1, ..., 5.x-dev].
    - kreait/laravel-firebase dev-main requires kreait/firebase-php ^5.18 -> satisfiable by kreait/firebase-php[5.18.0, ..., 5.x-dev].
    - kreait/firebase-php[5.21.0, ..., 5.x-dev] require google/auth ^1.16 -> satisfiable by google/auth[v1.16.0].
    - google/auth v1.16.0 requires guzzlehttp/psr7 ^1.2 -> found guzzlehttp/psr7[1.2.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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.
    - kreait/firebase-php[5.14.1, ..., 5.20.1] require guzzlehttp/psr7 ^1.7 -> found guzzlehttp/psr7[1.7.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (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 kreait/laravel-firebase ^3.1 -> satisfiable by kreait/laravel-firebase[3.1.0, 3.x-dev (alias of dev-main)].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Honestly, I have no idea why - it looks like conflicts around guzzlehttp/psr7 1.x and 2.x, but I'm not sure.

However, what worked for me, was to add the line

"kreait/laravel-firebase": "^3.1"

directly to the require section of the composer.json file and doing a composer update.

Does this work for you as well?

Yup that worked

composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 16 installs, 1 update, 0 removals
  - Locking fig/http-message-util (1.1.5)
  - Locking firebase/php-jwt (v5.4.0)
  - Locking google/auth (v1.16.0)
  - Locking google/cloud-core (v1.42.2)
  - Locking google/cloud-storage (v1.24.1)
  - Locking google/crc32 (v0.1.0)
  - Downgrading guzzlehttp/psr7 (2.0.0 => 1.8.2)
  - Locking kreait/clock (1.1.0)
  - Locking kreait/firebase-php (5.21.0)
  - Locking kreait/firebase-tokens (1.16.0)
  - Locking kreait/laravel-firebase (3.1.0)
  - Locking lcobucci/clock (2.0.0)
  - Locking lcobucci/jwt (4.1.4)
  - Locking mtdowling/jmespath.php (2.6.1)
  - Locking psr/cache (2.0.0)
  - Locking riverline/multipart-parser (2.0.8)
  - Locking rize/uri-template (0.3.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 16 installs, 1 update, 0 removals
  - Downloading psr/cache (2.0.0)
  - Downloading google/cloud-storage (v1.24.1)
  - Downloading kreait/firebase-tokens (1.16.0)
  - Downloading kreait/firebase-php (5.21.0)
  - Installing psr/cache (2.0.0): Extracting archive
  - Downgrading guzzlehttp/psr7 (2.0.0 => 1.8.2): Extracting archive
  - Installing firebase/php-jwt (v5.4.0): Extracting archive
  - Installing google/auth (v1.16.0): Extracting archive
  - Installing google/crc32 (v0.1.0): Extracting archive
  - Installing rize/uri-template (0.3.3): Extracting archive
  - Installing google/cloud-core (v1.42.2): Extracting archive
  - Installing google/cloud-storage (v1.24.1): Extracting archive
  - Installing lcobucci/clock (2.0.0): Extracting archive
  - Installing lcobucci/jwt (4.1.4): Extracting archive
  - Installing kreait/clock (1.1.0): Extracting archive
  - Installing fig/http-message-util (1.1.5): Extracting archive
  - Installing kreait/firebase-tokens (1.16.0): Extracting archive
  - Installing riverline/multipart-parser (2.0.8): Extracting archive
  - Installing mtdowling/jmespath.php (2.6.1): Extracting archive
  - Installing kreait/firebase-php (5.21.0): Extracting archive
  - Installing kreait/laravel-firebase (3.1.0): Extracting archive
9 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package sebastian/resource-operations is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: kreait/laravel-firebase
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: sentry/sentry-laravel
Discovered Package: spatie/laravel-http-logger
Discovered Package: spatie/laravel-permission
Package manifest generated successfully.
90 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

and was able to install https://github.com/laravel-notification-channels/fcm as well which initially made me discover the issue

> composer require laravel-notification-channels/fcm
Using version ^2.2 for laravel-notification-channels/fcm
./composer.json has been updated
Running composer update laravel-notification-channels/fcm
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking laravel-notification-channels/fcm (2.2.1)
  - Locking spatie/enum (3.9.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Installing spatie/enum (3.9.0): Extracting archive
  - Installing laravel-notification-channels/fcm (2.2.1): Extracting archive
Package sebastian/resource-operations is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: kreait/laravel-firebase
Discovered Package: laravel-notification-channels/fcm
Discovered Package: laravel/sail
Discovered Package: laravel/sanctum
Discovered Package: laravel/scout
Discovered Package: laravel/socialite
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: sentry/sentry-laravel
Discovered Package: spatie/laravel-http-logger
Discovered Package: spatie/laravel-permission
Package manifest generated successfully.
91 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Should be enough to get us up and running for now, thanks!

- Downgrading guzzlehttp/psr7 (2.0.0 => 1.8.2): Extracting archive
Not a great solution imho

The downgrade is a result of another dependency not supporting ^2.0 releases