Search code examples
androidkotlinandroid-studiorustsolana

Solana libraries in kotlin give unresolved reference


import com.solana.rpc.SolanaRpcClient
import com.solana.networking.KtorNetworkDriver

I have tried to import these libraries but they both give unresolved reference error. First one on rpc and the second one on KtorNetworkDriver. I have followed this documentation https://docs.solanamobile.com/android-native/rpc-requests hence added this dependancy and synced; also tried cleaning and rebuilding but the error persists. I literally cannot find any information on this since it's a niche topic.

dependencies {
    implementation("com.solanamobile:rpc-core:0.2.6")
} 

Solution

  • Doesn't solve your original question, but you can do it with sol4k as well. It uses minimum dependencies and shouldn't bring any issues importing.

    implementation 'org.sol4k:sol4k:0.5.1'
    

    Find the details in the documentation.