@20921556 写道:
分享的代码 var share_plugin = anysdk.agentManager.getSharePlugin(); var realUrl = cc.url.raw("resources/logo.png"); var info = { title : "测试标题", text : "测试内容", imagePath: realUrl, // imagePath 是图片的本地路径,Linked-In 以外的平台都支持此参数 url:"http://www.baidu.com", // url 仅在微信(包括好友和朋友圈)中使用 mediaType : "2", //微信 SDK 需要是用到的参数,分享类型: 0 - 文字 1 - 图片 2 - 网址 shareTo : "0", //微信 SDK 需要是用到的参数,分享到:0 - 聊天 1 - 朋友圈 2 - 收藏 thumbImage: realUrl, thumbSize:120 } share_plugin.share(info); logcat的日志 12-24 16:25:34.774: E/AndroidRuntime(21366): FATAL EXCEPTION: main Process: com.junjungame.paodekuai, PID: 21366 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitma p$CompressFormat, int, java.io.OutputStream)' on a null object reference at com.anysdk.framework.ShareWxpay.compressImage(ShareWxpa y.java:275) at com.anysdk.framework.ShareWxpay.getimage(ShareWxpay.jav a:268) at com.anysdk.framework.ShareWxpay.wxsharewebpage(ShareWxp ay.java:393) at com.anysdk.framework.ShareWxpay$2.run(ShareWxpay.java:1 52) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:529 0) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller. run(ZygoteInit.java:911) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java :706)
帖子: 1
参与者: 1