Android 本地ETH冷钱包开发,转账时候,
org.web3j:core:4.6.0-android 和 com.squareup.okhttp3:okhttp 3.12.3 冲突报错,异常展示
Exception: java.lang.NoSuchMethodError: No static method create(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody; in class Lokhttp3/RequestBody; or its super classes (declaration of 'okhttp3.RequestBody' appears in /data/app/~~RN8nor63ml8VEBzzFTlgBw==/com.app.debug-i_6b_0V66n1AVMCDcJQLWg==/base.apk!classes5.dex)
具体代码 Exception: java.lang.NoSuchMethodError: No static method create(Ljava/lang/String;Lokhttp3/MediaType;)Lokhttp3/RequestBody; in class Lokhttp3/RequestBody; )
由于okhttp3版本无法改变,所以将web3j版本改为4.2.0-android或者4.1.0-android都可运行,亲测有效,
原项目:okhttp3版本为3.1.2,web3j版本为4.6.0-android,可正常运行
web3j版本查看链接
GitHub - web3j/web3j at v4.2.0-android
|