0

I am getting below error :

android.graphics.drawable.AdaptiveIconDrawable cannot be cast to 
android.graphics.drawable.BitmapDrawable

My Code :

platform.ready().then(
function () {
  if (platform.is('android') && !platform.is('mobileweb')) {
   var success = function(app_list) { alert(JSON.stringify(app_list)); };
   var error = function(app_list) { alert("Oopsie! " + app_list); };
   Applist.createEvent('', '', '', '', '', success, error)
  }
 }
);

Ionic Project Details :

 Ionic CLI : 6.10.1 (...\Roaming\npm\node_modules@ionic\cli)
 Ionic Framework : @ionic/angular 5.2.3
 @angular-devkit/build-angular : 0.901.11
 @angular-devkit/schematics : 9.1.11
 @angular/cli : 9.1.11
 @ionic/angular-toolkit : 2.2.0

I am getting an error while retrieving a list of apps installed on device.

Harsha W
  • 3,162
  • 5
  • 43
  • 77
Hitesh Thakor
  • 471
  • 2
  • 12

1 Answers1

0

The error is probably due to the outdated Plugin AppList. Android now uses new version of icons: AdaptiveIconDrawable. Many pre-installed apps will return AdaptiveIconDrawable instance when you try to list down the details of installed apps on the device.

If you know a bit of Android Programming, you can try to update the plugin's code yourself. Follow this answer: https://stackoverflow.com/a/46018816/10602679

Else, you can request the plugin creator to update the Plugin.

Pankaj Sati
  • 2,441
  • 1
  • 14
  • 21