Caused by: java.lang.ClassCastException: com.tencent.mm.sdk.modelmsg.SendMessageToWX$Resp cannot be

真机调试时,总是报错

java.lang.ClassCastException: com.tencent.mm.sdk.modelmsg.SendMessageToWX$Resp cannot be cast to com.tencent.mm.sdk.modelmsg.SendAuth$Resp


后来发现导出签名、混淆发布版本是可以正常运行的。


真机联调时,需要用到第三方API的时候,需要一个key store 的SH1值,例如使用百度地图API,如果是协同开发,就需要所有Eclipse使用同一keystore。例如上述的微信sdk ,这时用默认的debug的keystore,就会导致上述莫名其妙的问题。


解决方法,参考下述地址说明的方法,用转换工具转换一下发布版本的keystore,用自定义的debug版keystore,,配置一下即可。。。



参考:https://github.com/IntellexApps/key2debug

参考:http://blog.csdn.net/lilu_leo/article/details/38989131

参考:http://stackoverflow.com/questions/15754060/how-to-set-a-custom-keystore-for-debugging-in-eclipse-for-android

你可能感兴趣的:(Caused by: java.lang.ClassCastException: com.tencent.mm.sdk.modelmsg.SendMessageToWX$Resp cannot be)