错误A / libc:致命信号6(SIGABRT)获得静态实例

时间:2019-04-22 09:08:23

标签: java cocos2d-iphone admob

在调用类实例时应用崩溃

public class AppActivity extends Cocos2dxActivity implements RewardedVideoAdListener {

    private static AppActivity _activity;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.setEnableVirtualButton(false);
        super.onCreate(savedInstanceState);

        if (_activity == null
        ) {
            _activity = this;
            Log.i("1", "called this");
        }
...
}
 public static void showAdPopup(){
        if (_activity != null
        ) {
            Log.i("1", "now this");
            _activity._showAdPopup();//error here
        }
        Log.i("1", "ad callssss2");
    }

_showAdPopup()未调用 我不知道_activity有什么问题 尝试了示例代码,但没有任何变化

Logcat错误:-

04-22 16:04:31.904 9956-9981/com.vn.Test E/dalvikvm: VM aborting
04-22 16:04:31.904 9956-9981/com.vn.Test A/libc: Fatal signal 6 (SIGABRT) at 0x000026e4 (code=-6), thread 9981 (Thread-534)
04-22 16:04:32.124 29009-29061/system_process E/InputDispatcher: channel '329b8fb0 com.vn.Test/org.cocos2dx.cpp.AppActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

0 个答案:

没有答案