Creator2.0.8 安卓打包后一运行闪退

编辑器Creator:2.0.8
android studio 3.2.1
运行平台 android8.1
构建配置模板采用default。
项目是在2.0.6编辑器上做的,现在升级到2.0.8.,在原来2.0.6时可以安卓编译出来正常运行。升级到2.0.8之后运行后就闪退了,升级完的项目在web上正常运行。
报错日志如下:

E/ANDR-PERF-OPTSHANDLER: perf_lock_rel: updated /sys/class/mmc_host/mmc0/clk_scaling/enable with 1
return value 2
In the constructor of HttpClient!
pushcore W/ResourceType: No package identifier when getting name for resource number 0x00000000
:pushcore W/ResourceType: No package identifier when getting name for resource number 0x00000000
D/JniHelper: JniHelper::getJavaVM(), pthread_self() = -997197456
pushcore W/ResourceType: No package identifier when getting name for resource number 0x00000000
--------- beginning of crash
W/ResourceType: No package identifier when getting name for resource number 0x000000
I/WifiService: getWifiEnabledState uid=10690
W/ContentCatcher: Failed to notify a WebView
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
W/google-breakpad: Chrome build fingerprint:
W/google-breakpad: 68.0.3440.91
W/google-breakpad: 344009150
W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 32626 (GLThread 4516),
obtaining output fd from tombstoned, type: kDebuggerdTombstone
I//system/bin/tombstoned: received crash request for pid 32576
I/crash_dump32: performing dump of process 32576 (target tid = 32626)
A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2019-02-12 10:36:10.516 582-582/? A/DEBUG: Build fingerprint: ‘xiaomi/wayne/wayne:8.1.0/OPM1.171019.011/V10.2.1.0.ODCCNXM:user/release-keys’
2019-02-12 10:36:10.516 582-582/? A/DEBUG: Revision: ‘0’
2019-02-12 10:36:10.516 582-582/? A/DEBUG: ABI: ‘arm’
2019-02-12 10:36:10.516 582-582/? A/DEBUG: pid: 32576, tid: 32626, name: GLThread 4516 >>> prod. <<<
2019-02-12 10:36:10.516 582-582/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2019-02-12 10:36:10.516 582-582/? A/DEBUG: Cause: null pointer dereference
2019-02-12 10:36:10.517 582-582/? A/DEBUG: r0 00000000 r1 00000000 r2 00000000 r3 00000000
2019-02-12 10:36:10.517 582-582/? A/DEBUG: r4 d4019ac4 r5 d2cc0224 r6 d4019afc r7 d2cc0ac0
2019-02-12 10:36:10.517 582-582/? A/DEBUG: r8 00000001 r9 e7ac3c00 sl 00000000 fp d2cbf760
2019-02-12 10:36:10.517 582-582/? A/DEBUG: ip d40542d4 sp d2cbf758 lr d2f567d0 pc f11642cc cpsr 600b0030
2019-02-12 10:36:10.523 582-582/? A/DEBUG: backtrace:
A/DEBUG: #00 pc 0001a2cc /system/lib/libc.so (strlen+71)
A/DEBUG: #01 pc 002947cc /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (std::__ndk1::char_traits::length(char const*)+20)
A/DEBUG: #02 pc 00395844 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (_ZNSt6__ndk1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc+44)
A/DEBUG: #03 pc 004c32b0 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (XMLHttpRequest::getHeader(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator> const&)+9172)
A/DEBUG: #04 pc 004c55c4 /data/app/prod_5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (XMLHttpRequest::onResponse(cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*)+3544)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #05 pc 004dc208 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (ZNSt6__ndk128__invoke_void_return_wrapperIvE6__callIJRNS_6__bindIM14XMLHttpRequestFvPN7cocos2d7network10HttpClientEPNS6_12HttpResponseEEJPS4_RKNS_12placeholders4__phILi1EEERKNSF_ILi2EEEEEES8_SA_EEEvDpOT+680)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #06 pc 004dbdbc /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (ZNSt6__ndk110__function6__funcINS_6__bindIM14XMLHttpRequestFvPN7cocos2d7network10HttpClientEPNS5_12HttpResponseEEJPS3_RKNS_12placeholders4__phILi1EEERKNSE_ILi2EEEEEENS_9allocatorISL_EEFvS7_S9_EEclEOS7_OS9+68)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #07 pc 0069ba04 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (std::__ndk1::function<void (cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*)>::operator()(cocos2d::network::HttpClient*, cocos2d::network::HttpResponse*) const+112)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #08 pc 006a3ebc /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #09 pc 006a3e48 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #10 pc 006a3c98 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #11 pc 0033955b /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (std::__ndk1::function<void ()>::operator()() const+38)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #12 pc 003b9994 /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (cocos2d::Scheduler::update(float)+1272)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #13 pc 00335c2f /data/app/prod._5HmBYZgEdqSHobg==/lib/arm/libcocos2djs.so (Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeRender+554)
2019-02-12 10:36:10.524 582-582/? A/DEBUG: #14 pc 00010ddf /data/app/prod._5HmBYZgEdqSHobg==/oat/arm/base.odex (offset 0xf000)

可能是和下面问题一样的,你参考调试看看。
https://forum.cocos.com/t/xmlhttprequest-android-app/70522/9?u=huanxinyin

我刚刚debug,走到这里就报错了实质上

我2.0.8打包出来的jsb_xmlhttprequest.cpp文件跟你说的不一样啊
void XMLHttpRequest::getHeader(const std::string& header)
{
// check for colon.
size_t found_header_field = header.find_first_of(":");

if (found_header_field != std::string::npos)
{
    // Found a header field.
    std::string http_field;
    std::string http_value;

    http_field = header.substr(0,found_header_field);
    http_value = header.substr(found_header_field+1, header.length());

    // Get rid of all \n
    if (!http_value.empty() && http_value[http_value.size() - 1] == '\n') {
        http_value.erase(http_value.size() - 1);
    }

    // Get rid of leading space (header is field: value format)
    if (!http_value.empty() && http_value[0] == ' ') {
        http_value.erase(0, 1);
    }

    // Transform field name to lower case as they are case-insensitive
    std::transform(http_field.begin(), http_field.end(), http_field.begin(), ::tolower);

    _httpHeader[http_field] = http_value;

}
else
{
    // Get Header and Set StatusText
    // Split String into Tokens
    char* cstr = new (std::nothrow) char [header.length()+1];

    // Seems like we have the response Code! Parse it and check for it.
    char* pch;
    strncpy(cstr, header.c_str(), header.length());
    cstr[header.length()] = '\0';

    pch = strtok(cstr, " ");
    while (pch != nullptr)
    {
        std::stringstream ss;
        std::string val;

        ss << pch;
        val = ss.str();
        size_t found_http = val.find("HTTP");

        // Check for HTTP Header to set statusText
        if (found_http != std::string::npos) {

            std::stringstream mystream;

            // Get Response Status
            pch = strtok (nullptr, " ");
            //mystream << pch;    //ignore HTTP statusCode 

            pch = strtok (nullptr, " ");
            mystream << pch;

            _statusText = mystream.str();
            
        }
        
        pch = strtok (nullptr, " ");
    }

    CC_SAFE_DELETE_ARRAY(cstr);
}

}
getHeader方法是这样子的

这里不是报错,点继续就好,既然可以调试,麻烦调试下看看什么情况好吗?只是一个单步就可以定位到问题原因,应该是不安全解析,我们这边暂时没有遇到过。

[quote=“huanxinyin, post:5, topic:73434”]
这里不是报错,点继续就好,既然可以调试,麻烦调试下看看什么情况好吗?只是一个单步就可以定位到问题原因,应该是不安全解析,我们这边暂时没有遇到过。
[/quote]主要是走到这里它就报错了,走不下去了

c++的代码在androidstudio上怎么调试,或者其他方式也可以,大佬可以教教吗

下载cocos2d-x-lite-2.1-release ,用其中的jsb_xmlhttprequest.cpp 覆盖默认的

网上没有找到这cocos2d-x-lite-2.1-release,请问在哪里啊?

楼主你解决没,我也遇到这个问题,华为手机尤其明显

我们跳过2.0.8了,直接升到2.0.9