pengyuxulyy 发表于 2015-5-10 17:36:53

手机端发送文件报错


手机型号, 红米note
android 4.4.4 KTU84P
问题描述:
将手机上的文件传输到web登录的机器上,文件名和用户ID正常,但是传输不成功

admin 发表于 2015-5-10 17:39:50

您好,请将完整的logcat中显示异常的信息帖上来,上面的附图所能看到的信息有限,谢谢。

另外,请将SD卡根目录下的日志文件:BRAnyChatCore.log也一并附上来帮您分析一下。

pengyuxulyy 发表于 2015-5-11 08:09:04

        ---------------------------AnyChat Platform Core SDK Client Log---------------------------
        Load libanychatcore.so success!(V5.1 Build Time:Sep 17 2014 15:29:02)
        Android OS SDK Version:19, Support ARMv7:2, Support Neon:4
        Load libmediautil_v7.so success!(V5.1 Build Time:Sep 17 2014 15:30:19)
        Load libmediashow_4.0.so failed,video display functions will fail!(dlopen failed: cannot locate symbol "_ZN7android7Surface7isValidEv" referenced by "libmediashow_4.0.so"...)
        dlopen failed: cannot locate symbol "_ZN7android6Camera17setPreviewDisplayERKNS_2spINS_7SurfaceEEE" referenced by "libmediacore_4.2.so"...
        Load libmediacore.so success!(V5.1 Build Time:Sep 17 2014 15:29:40)
        HM NOTE 1LTE(Xiaomi) msm82264.4.4
        Invoke        BRAC_Connect(10.28.23.197,8906)=0
        Invoke        LoginServer(username=lb)
        CheckClientSocketLink       Connect(ip=10.28.23.197,port=8906)
        Server version: V5.1(Build Time:2014-09-17 22:20:35, Server OS:Windows)
        Message        OnConnect(bSuccess:1, errorcode=0)
        Message        OnLoginSystem(userid=-138,errorcode=0,username=lb), msg deliver worked(0)
        Load libmediashow_4.0.so failed,video display functions will fail!(dlopen failed: cannot locate symbol "_ZN7android7Surface7isValidEv" referenced by "libmediashow_4.0.so"...)
        Connection to streaming media server successfully!(udp delay:20ms)
        Apply video parameter:320x240, bitrate:150000, quality:3, gop:40, fps:10, preset:3, codec:0
        Invoke        BRAC_SetSDKOption(BRAC_SO_NETWORK_P2PPOLITIC=1)
        Invoke        SetSDKOption(BRAC_SO_AUDIO_ECHOCTRL,1)
        Invoke        BRAC_SetSDKOption(BRAC_SO_CORESDK_USEHWCODEC=0)
        Invoke        EnterRoom(roomid=1)
        Message        OnEnterRoom(roomid=1,errorcode=0,siteindex=1)
        Audio Playback Device Init(0, 1, 16000, 16), Default Playback Driver
        Message        OnReceiveOnlineUser(count=2,roomid=1)
        Message        OnP2PConnectState(userid=-135, state=2)
        On Remote UserCameraControl(dwUserId:-135, bOpen:1)
        Message        OnP2PConnectState(userid=-135, state=3)
        On Remote UserSpeakControl(dwUserId:-135, bOpen:1)
        Invoke        BRAC_TransFile(dwUserid=-135, dwTaskId:971839616, PathName:/storage/emulated/0/DCIM/Camera/IMG_20150409_075546.jpg)=0

pengyuxulyy 发表于 2015-5-11 08:16:15

先调用一个文件选择器,然后根据选择的结果得到文件名,再进行传输
下面是传输的代码

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
                switch (requestCode) {
                case FILE_SELECT_CODE:   
                          // Toast.makeText(this, "选择文件:", Toast.LENGTH_LONG).show();
             if (resultCode == RESULT_OK) {
                // Get the Uri of the selected file
                Uri uri = data.getData();
                final String path = FileUtils.getPath(this, uri);         
                new Thread(new Runnable() {
                        @Override
                        public void run(){
                  transFile(position, path);
               
                   }
                        }
                  ).start();
               
                ;
            }         
            break;
          }

public int transFile(int position,String path){
           String id=idList.get(position);             
            return   anychat.TransFile(Integer.parseInt(id), path, 0, 0, 0, null);
    }

pengyuxulyy 发表于 2015-5-11 08:38:52


从打开文件选择器后到传输失败时的日志

廖斌 发表于 2015-5-11 09:20:49

pengyuxulyy 发表于 2015-5-11 08:16
先调用一个文件选择器,然后根据选择的结果得到文件名,再进行传输
下面是传输的代码



您好,最好一个参数不能传空

廖斌 发表于 2015-5-11 09:22:22

廖斌 发表于 2015-5-11 09:20
您好,最好一个参数不能传空

最后一个参数需要传一个AnyChatOutParam对象

pengyuxulyy 发表于 2015-5-11 09:30:24

不能为空吗

佰锐科技-杨子鳄 发表于 2015-5-11 09:32:38

不能   您参考一下开发文档

pengyuxulyy 发表于 2015-5-11 09:35:27

好了,谢谢
页: [1]
查看完整版本: 手机端发送文件报错