2017-10-14 65 views
0

我受限於在23.0.4版本中使用Android構建工具23和com.android.support庫。我必須添加Facebook Core到項目中,並且一切都很好,直到ProGuard進場。我可以使用Facebook Core 4/27與Android構建工具23嗎?

我生成過程中出現此錯誤:

Warning: Exception while processing task java.io.IOException: Can't write [android/app/build/intermediates/transforms/proguard/release/jars/3/1f/main.jar] (Can't read [android/app/build/intermediates/exploded-aar/com.android.support/support-compat/25.3.1/jars/classes.jar(;;;;;;**.class)] (Duplicate zip entry [android/support/v4/c/a/a.class == classes.jar:android/support/v4/graphics/drawable/DrawableCompat.class])) 
:app:transformClassesAndResourcesWithProguardForRelease FAILED 

有什麼辦法,我可以讓Facebook核心與我的應用程序工作,而我最終改變支持庫的版本?

回答

0

以防萬一您正在嘗試與我一樣。 對於4.27版本,這裏是你可以申請使用的是Android 23.

diff --git build.gradle build.gradle 
index e5c5761..9d298cb 100644 
--- build.gradle 
+++ build.gradle 
@@ -5,7 +5,7 @@ buildscript { 
     mavenCentral() 
    } 
    dependencies { 
-  classpath 'com.android.tools.build:gradle:2.3.3' 
+  classpath 'com.android.tools.build:gradle:2.2.0' 
    } 
} 

diff --git constants.gradle constants.gradle 
index 2b95ec8..94e35bb 100644 
--- constants.gradle 
+++ constants.gradle 
@@ -1,7 +1,7 @@ 
project.ext { 
- buildTools = "25.0.3" 
- supportLibraryVersion = "25.3.1" 
- compileSdk = 25 
+ buildTools = "23.0.3" 
+ supportLibraryVersion = "23.4.0" 
+ compileSdk = 23 
    minSdk = 15 
- targetSdk = 25 
-} 
\ No newline at end of file 
+ targetSdk = 23 
+} 
diff --git facebook-core/build.gradle facebook-core/build.gradle 
index 7f967b3..274f43f 100644 
--- facebook-core/build.gradle 
+++ facebook-core/build.gradle 
@@ -10,20 +10,19 @@ project.ext.url = 'https://github.com/facebook/facebook-android-sdk/facebook-cor 
dependencies { 
    // Facebook Dependencies 
    compile 'com.parse.bolts:bolts-android:1.4.0' 
- compile 'com.android.support:support-annotations:25.3.1' 
- compile 'com.android.support:support-core-utils:25.3.1' 
+ compile 'com.android.support:support-v4:23.4.0' 

    // Unit Tests 
    testCompile 'junit:junit:4.12' 
} 

android { 
- compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION) 
- buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION 
+ compileSdkVersion 23 
+ buildToolsVersion "23.0.3" 

    defaultConfig { 
     minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) 
-  targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) 
+  targetSdkVersion 23 
     consumerProguardFiles 'proguard-rules.pro' 
    } 

diff --git gradle.properties gradle.properties 
index 48ed711..60f3cd7 100644 
--- gradle.properties 
+++ gradle.properties 
@@ -1,5 +1,5 @@ 
ANDROID_BUILD_MIN_SDK_VERSION=15 
-ANDROID_BUILD_TARGET_SDK_VERSION=25 
-ANDROID_BUILD_TOOLS_VERSION=25.0.3 
-ANDROID_BUILD_SDK_VERSION=25 
-org.gradle.jvmargs=-Xmx1536M 
\ No newline at end of file 
+ANDROID_BUILD_TARGET_SDK_VERSION=23 
+ANDROID_BUILD_TOOLS_VERSION=23.0.3 
+ANDROID_BUILD_SDK_VERSION=23 
+org.gradle.jvmargs=-Xmx1536M 

這是討厭的,一定要打造成爲一個補丁,但如果你只需要分析,這是不夠好:/

相關問題