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

Time:12-23

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

CodePudding user response:

The problem seems to have been occurred with one of the plugins. I have faced this problem many a times, hence I always keep a backup of the entire project before any new plugin installation

performing the following tasks should help

cordova platform remove android

and then

cordova platform add android@latest

try with just android instead of @latest in case if you get the same error.

sometimes the json file stores the information and then never deletes it when you revoke the changes.

CodePudding user response:

The are many problems when you are trying to update to cordova-android 11. I recommend you follow in detail step by step in this article for the proper upgrade https://ionic.zendesk.com/hc/en-us/articles/7891143965975-Migrating-to-Cordova-Android-11

Also I had to add "types": [] to the "compilerOptions" in tsconfig.js After this I solve my problems

  • Related