Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot read property 'find' of null with cordova-android 11 in ionic 3

I have upgraded cordova-android to version 11 to support API Level 31 or above but when I'm creating build its giving error Cannot read property 'find' of null

I have done changes as suggested here Migrating to Cordova-Android 11 in Config.xml

        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="resources/android/icon/drawable-xxxhdpi-icon.png" />

removed all <splash> tags and uninstalled

cordova-plugin-splashscreen

and

cordova-plugin-androidx-adapter

still getting the error , please help

like image 833
Ajay verma Avatar asked Sep 12 '25 18:09

Ajay verma


2 Answers

I've faced the same problem. As suggest here, it was caused by some plugins.

In my case, the plugins was : cordova-plugin-telerik-imagepicker phonegap-plugin-barcodescanner

They're not actually maintain anymore, so i had to use those forks, both for the same guy : https://github.com/geraldapeoples/phonegap-plugin-barcodescanner https://github.com/geraldapeoples/ImagePicker

It's not really a good practice to use forked plugin, but i can't found other working plugin that do the job properly, and don't have the time neither skill to dev a new one by myself.

Migrate to cordova-android 11 is not an easy path, but the doc advised above by Cristian Zumelzu cover most of the problems i met.

like image 173
Nicoz Avatar answered Sep 14 '25 15:09

Nicoz


im added this to my config.xml and it works!!

<platform name="android">
    ...
    <config-file parent="/resources" target="app/src/main/res/values/themes.xml">
         <style name="Theme.App.SplashScreen" parent="Theme.SplashScreen">
              <item name="windowSplashScreenBackground">#FFFFFF</item>
              <item name="windowSplashScreenAnimatedIcon">@drawable/notification_icon.png</item>
              <item name="windowSplashScreenBrandingImage">@drawable/notification_icon.png</item>
              <item name="windowSplashScreenIconBackgroundColor">#FFFFFF</item>
              <item name="windowSplashScreenAnimationDuration">1000</item>
              <item name="postSplashScreenTheme">@style/MyTheme</item>
         </style>
    </config-file>
    ...
</platform>
like image 37
Raul Avatar answered Sep 14 '25 15:09

Raul