Ionic 2.0.0-beta.11 android/chromium cannot resolve all parameters for ActionSheetController

I’m building with cordova-android@3.7.1 so I can target API level 21 and have 50% device market share with the application.

When I emulate on an AVD with API 21, I get this error

D/CordovaLog: file:///android_asset/www/build/js/app.bundle.js: Line 33561:
Uncaught Cannot resolve all parameters for 'ActionSheetController'(?).
Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ActionSheetController' is decorated with Injectable.

09-06 15:27:32.380 2305-2305/com.hooktheory.hooktheory_two I/chromium:
[INFO:CONSOLE(33561)]
"Uncaught Cannot resolve all parameters for 'ActionSheetController'(?).
Make sure that all the parameters are decorated with Inject or have valid type annotations and that 'ActionSheetController' is decorated with Injectable.",
source: file:///android_asset/www/build/js/app.bundle.js (33561)

It is happening as the splash screen goes away and the application start screen is about to show. All I see is a white screen.

However, when I emulate in an AVD with API level 23, this problem does not happen. I have no clue how to fix this. Everything works fine when i compile for iOS.

I’m fairly convinced this errors was caused by lingering imports of 2.0.0-beta.6 components after my upgrade to 2.0.0-beta.11. Super frustrating.

After hours of comparing my codebase against freshly downloaded 2.0.0.beta-11 starters, I realized one file in my code imported Modal (a 2.0.0-beta.6 component) instead of the beta-11 ModalController. Similarly, I imported Alert (a beta-6 component) instead of AlertController

The only way I was able to figure this out is directly comparing starter code with my codebase. This didn’t cause crashes in the browser (ionic serve) and didn’t crash the native iOS build. Only certain API levels of Android. It didn’t crash API level 23 AVDs, but it crashed AVDs with API levels lower than 23.

It could have also been caused by the es6-shim. My 2.0.0-beta.6 app had import 'es6-shim'; rather than including it in the index.html which is the default in the 2.0.0.beta.11 style app.

Hopefully this helps someone out there.

I strongly recommand you to regularly check the changelog at each beta update; This is actually the right way to figure out what are the breaking changes added in the newer versions, and it will spare you hours or comparing your code with latest ionic starter.

They usually also provide at each update a guide on how to update your app and this is usually pretty straightforward.

1 Like

This seems to be a issue with reference in dependency Injection, Can you try in your Constructor class where you are using AlertController to
@Inject(AlertController) private alertController:AlertController

Hopefully this will help you solving this issue