3

As of gradle 3.0 the compile configuration is deprecated. According to the documentation and the answers to this question, when writing build.gradle dependencies api should have the same functionality as the old compile.

I have an Android library and changing compile 'org.java-websocket:Java-WebSocket:1.3.8' to api 'org.java-websocket:Java-WebSocket:1.3.8' causes the applications using it to crush with java.lang.NoClassDefFoundError when trying to instantiate a WebSocketClient. So does changing it to implementation 'org.java-websocket:Java-WebSocket:1.3.8'.

The only working solution so far seems to be requesting the applications to add implementation 'org.java-websocket:Java-WebSocket:1.3.8' to their dependencies but I would like to avoid it.

How can I keep the same functionality without using the deprecated compile?

Sir Codesalot
  • 7,045
  • 2
  • 50
  • 56

0 Answers0