2

I've just been working away normally on my Java project (not Android) in IntelliJ, not doing anything out of the ordinary. It's actually a Niagara 4 project.

For some strange reason, I've just attempted another build and got this:

Unable to find method 'org.bouncycastle.crypto.CryptoServicesRegistrar.isInApprovedOnlyMode()Z'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

You'll notice the stray 'Z' at the end of the method name. That's not my code: I'm guessing it is what my Gradle build is using to set up the signing of the JAR file I'm building: I have absolutely no idea where the corrupted method call is coming from (nor why it got corrupted in the first place !).

I've tried all the suggestions given by IntelliJ. I've cleaned the project. I've deleted the project's .gradle folder and gone back into IntelliJ to get it rebuilt. I've rebooted.

I'm out of ideas, other than thinking that the corruption is to a binary file as opposed to a readable gradle build or properties file.

Any thoughts what I can try ? It's been suggested I re-install Java (J8) ?

Gaz
  • 328
  • 3
  • 15
  • The Z is just the java shorthand that says the method returns a boolean. See section [4.3.2 here](https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html). – President James K. Polk Mar 31 '20 at 00:15

2 Answers2

3

Use bc-fips*.jar

Ref: https://mvnrepository.com/artifact/org.bouncycastle/bc-fips

Conflicts with bcprovjdk15-on*.jar

4b0
  • 21,981
  • 30
  • 95
  • 142
0

Which BC provider are you using and of course which release? It could be that the method is deprecated. For example, in the bcprovjdk15-on 1.65 the method is no longer there.

TylerH
  • 20,799
  • 66
  • 75
  • 101