Android build fails after upgrading gradle

Hi there.
I’m trying to publish my game in Google Play. It requires me to build aab file (since the size is bigger than 100M) and there begins the issue.
I previously user android gradle plugin 2.3. but aab feature requires gradle 3.5
So I did it (upgraded gradle). The gradle phase is working good, gradle sync is finishing without error. When I try to build aab or apk (whatever signed or unsigned) I receive the error:

Updating goal targets....
Considering target file `cocos2djs'.
    File `cocos2djs' does not exist.
    Looking for an implicit rule for `cocos2djs'.
    No implicit rule found for `cocos2djs'.
    Finished prerequisites of target file `cocos2djs'.
    Must remake target `cocos2djs'.
    make: *** No rule to make target `cocos2djs'. Stop.

Please help.
My cocos version is 3.16

Looks like I found the solution here