twitter-archive / twitter-kit-android

Twitter Kit for Android

Home Page:https://dev.twitter.com/twitterkit/android/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

After the SDK is imported, the compile passes, but the runtime error occurs.

asa526 opened this issue · comments

Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Administrator.gradle\caches\transforms-1\files-1.1\tweet-ui-3.2.0.aar\5001f588c3e856c7f1cccabe14bfc388\jars\classes.jar
Error:com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\Administrator.gradle\caches\transforms-1\files-1.1\tweet-ui-3.2.0.aar\5001f588c3e856c7f1cccabe14bfc388\jars\classes.jar
Error:com.android.builder.dexing.DexArchiveBuilderException: Error while dexing com/twitter/sdk/android/tweetui/internal/SwipeToDismissTouchListener.class
Error:com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

this is my gradle

compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "tw.zcj.android_tw"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

Did you setup your project for Java 8 compatibility?

yes I setup it. like this :
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

now I have a new problem:
Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'.

Unexpected inputs: ImmutableJarInput{name=com.facebook.android:facebook-applinks:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\104.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=android.arch.lifecycle:runtime:1.0.3, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\120.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-vector-drawable:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\112.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-share:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\99.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:appcompat-v7:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\102.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-core-ui:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\114.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-common:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\100.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-annotations:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\116.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:customtabs:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\107.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-android-sdk:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\97.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-messenger:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\105.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.parse.bolts:bolts-applinks:1.4.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\118.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-places:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\103.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=android.arch.lifecycle:common:1.0.3, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\121.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-login:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\98.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:animated-vector-drawable:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\111.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:cardview-v7:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\101.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-media-compat:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\113.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.parse.bolts:bolts-android:1.4.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\117.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-fragment:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\109.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-v4:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\108.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-compat:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\115.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.facebook.android:facebook-core:4.33.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\106.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.zxing:core:3.3.0, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\119.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.android.support:support-core-utils:27.0.2, file=E:\AndroidProjects\Android_twitter\app\build\intermediates\transforms\desugar\debug\110.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}

ROMEOPOKER

You can fix that by adding

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

to your app build gradle

We are also facing same issue even after adding compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}.
Any solution for this ?