2015-12-30 109 views
1

我想讀,我使用Fabric.On閱讀應用認證的官方文檔在Twitter上用戶的時間表,我發現這種方法與織物應用程序崩潰而初始化面料的Android

TwitterAuthConfig authConfig = new TwitterAuthConfig(Constants.TWITTER_API_KEY, Constants.TWITTER_API_SECRET); 
Fabric.with(this, new Twitter(authConfig)); 

並獲得認證這個錯誤

12-30 22:15:37.202 25440-25440/com.iifa.utsavam W/dalvikvm﹕ VFY: rejected Lcom/twitter/sdk/android/core/internal/TwitterSessionVerifier;.verifySession (Lcom/twitter/sdk/android/core/Session;)V 
12-30 22:15:37.202 25440-25440/com.iifa.utsavam W/dalvikvm﹕ VFY: rejecting opcode 0x0d at 0x0017 
12-30 22:15:37.202 25440-25440/com.iifa.utsavam W/dalvikvm﹕ VFY: rejected Lcom/twitter/sdk/android/core/internal/TwitterSessionVerifier;.verifySession (Lcom/twitter/sdk/android/core/Session;)V 
12-30 22:15:37.202 25440-25440/com.iifa.utsavam W/dalvikvm﹕ Verifier  rejected class  Lcom/twitter/sdk/android/core/internal/TwitterSessionVerifier; 
12-30 22:15:37.212 25440-25440/com.iifa.utsavam D/AndroidRuntime﹕ Shutting down VM 
12-30 22:15:37.212 25440-25440/com.iifa.utsavam W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x418038b0) 
java.lang.VerifyError: com/twitter/sdk/android/core/internal/TwitterSessionVerifier 
     at com.twitter.sdk.android.core.TwitterCore.onPreExecute(TwitterCore.java:126) 
     at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44) 
     at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611) 
     at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43) 
     at io.fabric.sdk.android.Kit.initialize(Kit.java:66) 
     at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:439) 
     at io.fabric.sdk.android.Fabric.init(Fabric.java:383) 
     at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:340) 
     at io.fabric.sdk.android.Fabric.with(Fabric.java:311) 
     at com.iifa.utsavam.AuthActivity.onLoginSkip(AuthActivity.java:75) 
     at com.iifa.utsavam.AuthActivity_$1.onClick(AuthActivity_.java:93) 
     at android.view.View.performClick(View.java:4421) 
     at android.view.View$PerformClick.run(View.java:17904) 
     at android.os.Handler.handleCallback(Handler.java:730) 
     at android.os.Handler.dispatchMessage(Handler.java:92) 
     at android.os.Looper.loop(Looper.java:137) 
     at android.app.ActivityThread.main(ActivityThread.java:5214) 
     at java.lang.reflect.Method.invokeNative(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:525) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 
     at dalvik.system.NativeStart.main(Native Method) 

這些都是我的品位文件

buildscript { 
repositories { 
    jcenter() 
    maven { url "https://jitpack.io" } 

} 
dependencies { 
    classpath 'com.android.tools.build:gradle:1.2.3' 

    classpath 'me.tatarka:gradle-retrolambda:3.2.1' 
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' 

    // NOTE: Do not place your application dependencies here; they belong 
    // in the individual module build.gradle files 
} 
} 

allprojects { 
repositories { 
    jcenter() 
    mavenCentral() 
    maven { url "https://jitpack.io" } 
} 
} 

而我的應用程序gradle這個

buildscript { 
repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

dependencies { 
    classpath 'io.fabric.tools:gradle:1.+' 
} 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

apply plugin: 'me.tatarka.retrolambda' 
apply plugin: 'android-apt' 

repositories { 
maven { url 'https://maven.fabric.io/public' } 
} 


android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "com.example.linux.tweener" 
    minSdkVersion 15 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.android.support:appcompat-v7:23.1.1' 
apt 'org.androidannotations:androidannotations:3.2' 
compile 'org.androidannotations:androidannotations-api:3.2' 
compile 'com.android.support:design:23.1.1' 
compile 'com.github.bmelnychuk:atv:1.2.7' 
compile 'io.reactivex:rxandroid:0.24.0' 
compile 'uk.co.chrisjenx:calligraphy:2.1.0' 
compile 'com.google.code.gson:gson:2.3.1' 
compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0' 
compile 'com.squareup.okhttp:okhttp:2.5.0' 
compile 'com.makeramen:roundedimageview:1.5.0' 
compile 'com.google.android.gms:play-services:6.5.+' 
compile 'com.squareup.retrofit:retrofit:1.8.0' 
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1' 
compile('com.github.afollestad.material-dialogs:core:[email protected]') { 
    transitive = true 
} 
// compile 'com.github.traex.rippleeffect:library:1.0.2' 
compile 'com.pnikosis:materialish-progress:1.7' 
compile 'com.github.citux:datetimepicker:0.2.0' 
compile 'com.github.bmelnychuk:atv:1.2.7' 
compile 'com.facebook.android:facebook-android-sdk:4.3.0' 
compile('com.twitter.sdk.android:twitter:[email protected]') { 
    transitive = true; 

} 
} 
+0

是否使用eclipse或studio? –

+0

工作室。我做了一個虛擬的應用程序,它的工作正常與相同的設置 – thestrongenough

+0

顯示完整的日誌貓 –

回答

0

適用面料

TwitterAuthConfig authConfig = new TwitterAuthConfig(Constants.TWITTER_CONSUMER_KEY, Constants.TWITTER_CONSUMER_SECRET); 

     // For Simple Login: 
     Fabric.with(this, new Twitter(authConfig)); 

     // For Simple Login as well as add crashlytics. 
     Fabric.with(this, new Twitter(authConfig), new Crashlytics()); 

     // For Post Tweets 
     Fabric.with(this, new TwitterCore(authConfig), new TweetComposer()); 

也ü需要在清單文件中添加權限

<meta-data 
      android:name="io.fabric.ApiKey" 
      android:value="--Add Your Key Here--" /> 

檢查您的build.gradle文件(應用模塊)

apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 

和建立依賴關係

// For Crashlytics 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    // For Twitter Login 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
     transitive = true; 
    } 

請按照此操作。

+0

我有所有基本的東西,我做了一個正常工作的虛擬應用程序。 – thestrongenough