简体   繁体   中英

Fabric Twitter Login Android throwing errors

We have integrated twitter fabric twitter plugin into my eclipse android application. After all the step by step process was done, i am getting the error like

 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)

Edited:

Hey thanks for your reply here is my login call back code automatically generated by fabric plugin :

      @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);
        }

and my build.gradle file :

         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
            }
             }

You need to declare the OAuthActivity in your project's manifest file. I had the same issues, worked after putting the following lines in Androidmanifest.xml.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM