Home > database >  Cordova - BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_&#
Cordova - BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_&#

Time:12-05

Node        : 16.13.2
Cordova     : 11.0.0
Java JDK    : 19.0.1
Gradle      : 7.5.1
Android SDK : Level 33

So I have been building apps just fine, but Play Console warned me that I should be targeting API level 33, (I previously built 30)

So I opened Android Studio and downloaded API level 31,32,33. Builds have been failing ever since, and I have been upgrading whatever else to get compatible components.

I don't remember why I needed to, or if I updated Cordova also, but I did upgrade Node.js or npm. I might have just given after all the colored text saying I'm using an old version, and then I've just been chasing the rabbit ever since. I don't remember if I got Java version failure before or after I upgraded Gradle from Android studio. Anyway I got a message saying Gradle required Java 11 and I had 1.8. I think this is good as the earlier 1.8 seem ancient. I did the Java update, and got a prior bug saying

deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

I upgraded Gradle manually, and after this I got another bug saying:

BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 63

One thing I noticed in my package.json is this:

  "devDependencies": {
    "cordova-android": "^10.1.2"
  },

Which is off from version 11 that I have.

I guess downgrading something is not an option since I need to target latest API level. But I'd like to know what versions you got working both level 30 and 33.

screenshot console

CodePudding user response:

Just gonna let you know I upgraded npm and was able to build successfuly.

New major version of npm available! 8.19.2 -> 9.1.3
  • Related