Facebook登录按钮崩溃的应用程序,没有错误消息 [英] Facebook Login Button crashing app without error message

查看:285
本文介绍了Facebook登录按钮崩溃的应用程序,没有错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题在工作了好几个星期后,今天早晨突然弹出.

This issue suddenly popped up this morning after working great for weeks.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FacebookSdk.sdkInitialize(getApplicationContext());
    setContentView(R.layout.activity_login);

    callbackManager = CallbackManager.Factory.create();
    LoginButton loginButton = (LoginButton) findViewById(R.id.authButton);
    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            Log.d("Facebook Login Status", "success!");
        }

        @Override
        public void onCancel() {
            Log.d("Facebook Login Status", "Canceled!");
        }

        @Override
        public void onError(FacebookException exception) {
            Log.d("Facebook Login Status", "Failed!");
        }


    });

}

其中某个地方,应用程序崩溃了.没有任何回调方法运行,并且没有任何内容输出到logcat.我只看到一秒钟的加载微调框,然后应用程序强制关闭,没有任何消息.

Somewhere in there, the app crashes. None of the callback methods are run, and nothing is printed to logcat. I just see a loading spinner for a split second and then the app force closes with no message.

我确实找到了该日志,但是我不知道这意味着什么.

I did find this log actually, but I don't know what it means.

04-24 15:44:56.787 1753-1753/com.android.systemui W/ResourceType: No package identifier when getting value for resource number 0x00000000
04-24 15:44:56.788 1753-1753/com.android.systemui W/PackageManager: Failure retrieving resources for com.devon_dickson.apps.oncampus: Resource ID #0x0

推荐答案

我也遇到了同样的情况,所以我从头开始创建了另一个Activity,然后慢慢地复制了新的活动,直到它与被破坏的活动相匹配.简而言之,除了Android Manifest之外,这与Activity无关.

The same was happening to me, so I started from scratch with another Activity and slowly duplicated the new activity till it matched the one that was breaking. In short, it was nothing to do with the Activity but the Android Manifest.

在我的Android清单中,我的LoginActivity上有android:noHistory="true",这使我的应用程序崩溃了.一旦我将其删除,便可以再次使用.

In my Android Manifest, I had android:noHistory="true" on my LoginActivity which was crashing my app. Once I removed it then it worked again.

这篇关于Facebook登录按钮崩溃的应用程序,没有错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆