Hi @samikshas963487 , Please follow the steps suggested by @arunpatidar , Along with that you can also check on below points.
You’re encountering a NoClassDefFoundError related to Kotlin dependencies. This error typically occurs when the Kotlin standard library is not included in your project.
- Add Kotlin Standard Library Dependency in pom.xml.
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.8.0</version>
</dependency>
- Embed Kotlin Library in Your OSGi Bundle by configuring maven-bundle-plugin in pom.xml.
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.2.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>kotlin-stdlib</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
- Ensure All Necessary Dependencies Are Included in pom.xml.
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.9.0</version>
</dependency>
Hope this will help you !
Regards,
Shiv Prakash