Rapidjson android error - assertion "IsString()" failed'

Hi,

I am getting response from sever and able to parse the data successfully when i run in ios simulator but when i run on android device app closes with msg “unfortunately app has stopped”

and here is the log of error i get -

(22798): Abort message: '/Users/mihir/Desktop/test/proj.android/../cocos2d/external/flatbuffers/../json/document.h:1681: const Ch* rapidjson::GenericValue<Encoding, Allocator>::GetString() const [with Encoding = rapidjson::UTF8<>; Allocator = rapidjson::MemoryPoolAllocator<>; rapidjson::GenericValue<Encoding, Allocator>::Ch = char]: assertion "IsString()" failed'

Here is my rapidjson parsing code -

        if (response->isSucceed()) {
        log("Get success");
        
        std::vector<char>* buffer = response->getResponseData();
        std::string res;
        res.insert(res.begin(), buffer->begin(), buffer->end());
        log("res: %s", res.c_str());
       
        rapidjson::Document d;
        d.Parse<0>(res.c_str());
        if(d.IsObject()){

            
            F = d["F"].GetString();
            W = d["W"].GetString();
            T = d["T"].GetString();
            Fp = d["Fp"].GetString();
            Wp = d["Wp"].GetString();
            Tp = d["Tp"].GetString();
            
            
            const rapidjson::Value& a = d["list"]; // Using a reference for consecutive access is handy and faster.
            assert(a.IsArray());
            for (rapidjson::SizeType i = 0; i < a.Size(); i++)
            {
             
                this->arr[i] = a[i].GetString();
            }
 }

Thank you…

Take a look at this please.

I checked that link…

I also logged the output of res

And here is my log in android -

res: {"F":null,"W":null,"T":null,"Fp":null,"Wp":null,"Tp":null,"msg":"Invalid","sid":null}

And in Ios Simulator -

res: {"F":"135","W":"1","T":"1","Fp":"1","Wp":"1","Tp":"1","msg":"success","sid":"1nf9ecj3j2nmm2lmamblf27n34"}

the same server code is returning success in ios simulator and invalid via android…

I echo $_SESSION[‘sid’] i set in login page and i echo it in this page, but i receive null in android device but in ios it receives the stored session id and successfully gets all the data, How is this happening?