Tribler / kotlin-ipv8

P2P communication library for Android
62 stars 27 forks source link

Error when used in trustchain-superapp #20

Closed PraveshMoelchand closed 4 years ago

PraveshMoelchand commented 4 years ago

We've encountered an issue with kotlin-ipv8. When using the most recent version of the kotlin-ipv8 repo in the trustchain-superapp, the following errors are introduced in the tests in kotlin-ipv8:

> Task :ipv8:compileTestKotlin FAILED
e: /Users/runner/runners/2.169.0/work/trustchain-superapp/trustchain-superapp/kotlin-ipv8/ipv8/src/test/java/nl/tudelft/ipv8/BaseCommunityTest.kt: (21, 2): Unresolved reference: OptIn
e: /Users/runner/runners/2.169.0/work/trustchain-superapp/trustchain-superapp/kotlin-ipv8/ipv8/src/test/java/nl/tudelft/ipv8/BaseCommunityTest.kt: (21, 8): This class can only be used as an annotation or as an argument to @UseExperimental
e: /Users/runner/runners/2.169.0/work/trustchain-superapp/trustchain-superapp/kotlin-ipv8/ipv8/src/test/java/nl/tudelft/ipv8/attestation/trustchain/TrustChainCrawlerTest.kt: (19, 2): Unresolved reference: OptIn
e: /Users/runner/runners/2.169.0/work/trustchain-superapp/trustchain-superapp/kotlin-ipv8/ipv8/src/test/java/nl/tudelft/ipv8/attestation/trustchain/TrustChainCrawlerTest.kt: (19, 8): This class can only be used as an annotation or as an argument to @UseExperimental

I saw that in the trustchain-superapp:master and trustchain-superapp:dao older commits of kotlin-ipv8 are used, this explains why the error did not show up before on GitHub. I am trying to figure out at the moment which commit exactly of kotlin-ipv8 has introduced the error.

PraveshMoelchand commented 4 years ago

UPDATE:

I've traced down the error to the following commit: https://github.com/Tribler/kotlin-ipv8/commit/827e3a5a208c304b109515bfe0e62027ab9add71. The reason why the error is not showing up in this repo, but is only showing up in the trustchain-superapp repo, is that the Kotlin version of trustchain-superapp has not been updated. Therefore, the @OptIn annotation is unresolved. I created a fix in the following PR: https://github.com/Tribler/trustchain-superapp/pull/20