App loads forever in --prod

To make it short to begin with I have built a little app in the last weeks and it is already running fine in debug mode.
Now that I felt ready for the first release of my app I ran “ionic build android --release --prod” which worked fine, I signed the app according to the “deploy guide” and then manually installed the app on my phone ( after I deleted the debug version ).
Now the app got installed successfully but when I now start the app it never leaves the splash screen. The loading spinner of the splashscreen is just running and running - it will never stop.

Didn’t see it before but I can see an error in the console when I remote debug it via chrome:

Uncaught Error: Cannot resolve all parameters for 't'(?). Make sure that all the parameters are decorated with Inject or have valid type annotations and that 't' is decorated with Injectable.
    at g (file:///android_asset/www/build/polyfills.js:3:7133)
    at T (file:///android_asset/www/build/main.js:1:6052)
    at U (file:///android_asset/www/build/main.js:1:7927)
    at M (file:///android_asset/www/build/main.js:1:6773)
    at V (file:///android_asset/www/build/main.js:1:7021)
    at Array.map (native)
    at L (file:///android_asset/www/build/main.js:1:7068)
    at Function.n.resolve (file:///android_asset/www/build/main.js:2:25003)
    at Function.n.resolveAndCreate (file:///android_asset/www/build/main.js:2:25071)
    at file:///android_asset/www/build/main.js:1:9775
    at file:///android_asset/www/build/main.js:1:9722
    at Object.<anonymous> (file:///android_asset/www/build/main.js:38:98)
    at t (file:///android_asset/www/build/main.js:1:101)
    at file:///android_asset/www/build/main.js:1:483
    at file:///android_asset/www/build/main.js:1:494

I found no issues on the forums or internet in general with this and I have absolutely NO idea what to do. Any ideas?

This is 99,9% related to using --prod, but could you make sure but only using --prod and not --release to build please?

Yea sure, sorry didn’t mention. I already tried “ionic run android --prod” to see if I get the same issue and it is exactly the same with this. ( sorry I wanted to answer immediately but this forum doesn’t let me… I have to wait several minutes -.- )

1 Like

Go through the constructor parameters of all your classes and make sure that their types are annotated with Injectable(). Ditto for any unusual provider entries in your app module.