2015-04-16 44 views
1

我複製並粘貼代碼看起來像需要幫助整合面料爲Android工作室

buildscript { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.fabric.io/public' } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.1.0' 

     // The Fabric Gradle plugin uses an open ended version to 
     // react quickly to Android tooling updates 
     classpath 'io.fabric.tools:gradle:1.+' 

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

apply plugin: 'com.android.application' 

//Put Fabric plugin after Android plugin 
apply plugin: 'io.fabric' 

allprojects { 
    repositories { 
     jcenter() 
     maven { url 'https://maven.fabric.io/public' } 
    } 
} 

,但是當我在同步的gradle,它說,沒有compile.minimumSdkVersion。我沒有看到這個就說明

+0

可您發佈的gradle全面的文件?每個android需要設置SDK版本和最小SDK版本。 –

+0

@dthacker事情是我已經在我的其他build.gradle文件中設置了sdk。當我把面料整合起來的時候,我不會再犯這個錯誤了。 –

+0

檢查此鏈接http://stackoverflow.com/questions/29569200/twitter-kit-fabric-android-on-module-library-android-studio/29671401#29671401 –

回答

1

我的文件項目 /app/build.gradle

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

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

apply plugin: 'com.android.application' 

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

apply plugin: 'io.fabric' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 

    defaultConfig { 
     applicationId "<YOUR_APP>" 
     minSdkVersion 9 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:22.2.1' 
    compile('com.twitter.sdk.android:twitter:[email protected]') { 
     transitive = true; 
    } 
}