Fabric Twitter登录Android抛出错误

时间:2014-11-13 06:36:02

标签: android twitter twitter-fabric

我们已将twitter fabric 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
            }
             }

1 个答案:

答案 0 :(得分:6)

您需要在项目的清单文件中声明OAuthActivity。 我有同样的问题,在Androidmanifest.xml中放入以下行后工作。

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