面料的Twitter登录的Android引发错误(Fabric Twitter Login Andr

2019-10-21 06:53发布

我们已经集成Twitter的面料叽叽喳喳插件安装到我的Eclipse的Android应用程序。 所有的循序渐进的过程被完成后,我收到类似错误

 11-12 19:01:54.263: E/NativeCrypto(22663): ssl=0x530f7cc0 cert_verify_callback x509_store_ctx=0x5248cab8 arg=0x0
 11-12 19:01:54.263: E/NativeCrypto(22663): ssl=0x530f7cc0 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA
 11-12 19:01:57.027: E/AndroidRuntime(22663): FATAL EXCEPTION: main
 11-12 19:01:57.027: E/AndroidRuntime(22663): android.content.ActivityNotFoundException: Unable to find explicit activity class       {om.example.testtwit/com.twitter.sdk.android.core.identity.OAuthAcctivity}; have you declared this activity in your AndroidManifest.xml?
 11-12 19:01:57.027: E/AndroidRuntime(22663):   at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1624)
 11-12 19:01:57.027: E/AndroidRuntime(22663):   at android.app.Instrumentation.execStartActivity(Instrumentation.java:1423)
 11-12 19:01:57.027: E/AndroidRuntime(22663):   at android.app.Activity.startActivityForResult(Activity.java:3388)

编辑:

嘿感谢您的回复,这里是我的登录回调代码由布插件自动生成:

      @Override
      protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
       loginButton = (TwitterLoginButton) findViewById(R.id.twitter_login_button);
       loginButton.setCallback(new Callback<TwitterSession>() {
         @Override
         public void success(Result<TwitterSession> result) {
             // Do something with result, which provides a TwitterSession for making API calls
         }

         @Override
         public void failure(TwitterException exception) {
            // Do something on failure
         }
        });
        }

        @Override
        protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        loginButton.onActivityResult(requestCode, resultCode, data);
        }

我的build.gradle文件:

         buildscript {
          repositories {
         jcenter()
         maven { url 'https://maven.fabric.io/repo' }
          }
         dependencies {
         classpath 'com.android.tools.build:gradle:0.13.3'
         // The Fabric Gradle plugin uses an open ended version to react
         // quickly to Android tooling updates
          classpath 'io.fabric.tools:gradle:1.+'
          }
          }

         apply plugin: 'com.android.application'
          apply plugin: 'io.fabric'

          repositories {
           jcenter()
           maven { url 'https://maven.fabric.io/repo' }
           }

           android {
           compileSdkVersion 19
           buildToolsVersion "20.0.0"

           defaultConfig {
           minSdkVersion 15
           targetSdkVersion 19
             }
             }

           dependencies {
           // Crashlytics Kit
           compile('com.crashlytics.sdk.android:crashlytics:2.0.1@aar') {
            transitive = true
             }

           // Twitter Kit
           compile('com.twitter.sdk.android:twitter:1.0.1@aar') {
            transitive = true
             }

           // MoPub Kit
           compile('com.mopub.sdk.android:mopub:3.2.2@aar') {
           transitive = true
            }
             }

Answer 1:

您需要在申报项目的清单文件中OAuthActivity。 我有同样的问题,把以下行的AndroidManifest.xml中的工作后。

        <activity android:name="com.twitter.sdk.android.core.identity.OAuthActivity" />


文章来源: Fabric Twitter Login Android throwing errors