Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The definition for "kreait\firebase\factory" has no class. #26

Closed
iamakanksha opened this issue Jul 14, 2020 · 9 comments
Closed

The definition for "kreait\firebase\factory" has no class. #26

iamakanksha opened this issue Jul 14, 2020 · 9 comments

Comments

@iamakanksha
Copy link

iamakanksha commented Jul 14, 2020

The problem

Installed the bundle (version 1.2) using composer. Added the bundle to the AppKernel.php and pushed the commit to GitHub. My build is failing due to the following error:

[Symfony\Component\DependencyInjection\Exception\RuntimeException]                                                                                                         
  The definition for "kreait\firebase\factory" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true. If this is an a  
  bstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this error. 

Environment

  • PHP Version:
    7.1.33
  • Symfony version:
    2.8.52
  • Firebase PHP SDK and Bundle version:
    kreait/firebase-bundle 1.2.0 Symfony Bundle for the Firebase Admin SDK
    kreait/firebase-php 4.18.0 Firebase Admin SDK
    kreait/firebase-tokens 1.7.2 A library to work with Firebase tokens
    kreait/gcp-metadata 1.0.1 Get the metadata from a Google Cloud Platform environment.

Details

Tried to set up the bundle with the project, by registering it in AppKernel.php, which is one of the initial steps and it is failing at that point.

Code to reproduce issue

Inside app/AppKernel.php


// ...
class AppKernel extends Kernel
{
    // ...

    public function registerBundles()
    {
        $bundles = array(
            // ...
           new Kreait\Firebase\Symfony\Bundle\FirebaseBundle()
        );
        // ...
    }
}
@jeromegamez
Copy link
Member

I believe you need to write new \Kreait instead of new Kreait (prepend a backslash)

@iamakanksha
Copy link
Author

I believe you need to write new \Kreait instead of new Kreait (prepend a backslash)

I tried this out but the issue remains

@jeromegamez
Copy link
Member

1.2 is a rather old release of the bundle, it might be a bug. Is there a reason why newer 1.x versions of the bundle don't work?

@iamakanksha
Copy link
Author

iamakanksha commented Jul 14, 2020

1.2 is a rather old release of the bundle, it might be a bug. Is there a reason why newer 1.x versions of the bundle don't work?

My project uses symfony version 2.8, kreait/firebase-php version 4.18 and firebase-bundle 1.2 seems like the last version compatible with the symfony and firebase-php version used by the project

@jeromegamez
Copy link
Member

Have you added code to your application using the SDK, or does the error occur already only by adding the bundle?

Unfortunately I don't have the capacities at the moment to look into it (and Symfony 2.x has been out of support for quite some time now), that's why I currently only can ask question to help guessing what the issue might be.

Given that it's broken for you, it's totally possible that the bundle is generally broken for Symfony 2.x. Perhaps the best solution would be to take the bundle as a kind of blueprint and implement it yourself specifically for your project 🤔

@iamakanksha
Copy link
Author

Have you added code to your application using the SDK, or does the error occur already only by adding the bundle?

Unfortunately I don't have the capacities at the moment to look into it (and Symfony 2.x has been out of support for quite some time now), that's why I currently only can ask question to help guessing what the issue might be.

Given that it's broken for you, it's totally possible that the bundle is generally broken for Symfony 2.x. Perhaps the best solution would be to take the bundle as a kind of blueprint and implement it yourself specifically for your project 🤔

The error occurs only on adding the bundle to the project

@iamakanksha
Copy link
Author

Tried to update my firebase-php version to a higher version that supports Symfony 2.8 so that I could update the firebase-bundle version. I directly tried to update the firebase-php to version 4.35 to be able to use version the bundle version 1.7, however the installation itself failed. I tried to update the firebase-php version to 4.22 so that I could upgrade to bundle version 1.3, but this issue remains in that version.

@iamakanksha
Copy link
Author

@jeromegamez I am unable to create a PR on the older tag of the repository (1.2.0)

@jeromegamez
Copy link
Member

I just released 1.2.1 with your changes. Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants