Android gradle需要一个小时的在线构建
我的应用程序 实际上,在线构建需要一个多小时。 (在线构建是指未选中Gradle离线构建) 然而,在离线构建中,大约需要5-10分钟。 每当我想增加新的图书馆,我将不得不建立在线Android gradle需要一个小时的在线构建,android,build,android-gradle-plugin,crashlytics-android,Android,Build,Android Gradle Plugin,Crashlytics Android,我的应用程序 实际上,在线构建需要一个多小时。 (在线构建是指未选中Gradle离线构建) 然而,在离线构建中,大约需要5-10分钟。 每当我想增加新的图书馆,我将不得不建立在线 buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies { classpath 'io.fabric.tools:gradle:1.+' } } apply plugi
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'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.licianhorse.management.android"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.1"
multiDexEnabled true
android {
defaultConfig {
manifestPlaceholders = [manifestApplicationId: "${applicationId}",
onesignal_app_id: "df5308f0-b573-4247-ac2f-88924310870f",
onesignal_google_project_number: "523535792051"]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//One Signal Dependencies
// compile 'com.onesignal:OneSignal:2.+@aar'
// compile 'com.google.android.gms:play-services-gcm:+'
// compile 'com.google.android.gms:play-services-analytics:+'
// compile "com.google.android.gms:play-services-location:+"
//One Signal Dependencies
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'com.jakewharton.timber:timber:2.5.0'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.squareup.picasso:picasso:2.4.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.crashlytics.android:crashlytics:1.1.13'
compile 'com.google.dagger:dagger-producers:2.0-beta'
compile "com.google.dagger:dagger-compiler:2.0"
compile 'fr.avianey.com.viewpagerindicator:library:2.4.1@aar'
// compile ('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar') {
// transitive = true
// }
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.makeramen:roundedimageview:2.1.1'
// compile 'com.amazonaws:aws-android-sdk-core:2.+'
// compile 'com.amazonaws:aws-android-sdk-cognito:2.+'
// compile 'com.amazonaws:aws-android-sdk-s3:2.+'
// compile 'com.amazonaws:aws-android-sdk-ddb:2.+'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.nostra13.universalimageloader:universal-image- loader:1.9.3'
provided 'javax.annotation:jsr250-api:1.0'
compile project(":libraries:couchbase-lite-android")
compile project(":libraries:couchbase-lite-java-core")
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
}
在Android Studio中,转到
`File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
检查“全局渐变设置”下的“脱机工作”
它将大大减少渐变构建时间
但如果您想使用新库,那么唯一的方法是在开始时将联机工作放在一次,让它构建一次,然后再次选中脱机工作选项
希望这对你有用。在Android Studio中
转到
`File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
检查“全局渐变设置”下的“脱机工作”
它将大大减少渐变构建时间
但如果您想使用新库,那么唯一的方法是在开始时将联机工作放在一次,让它构建一次,然后再次选中脱机工作选项
希望这对您有用。您可能有代理,您可能最近更改了密码,或者从设置的角度看发生了一些变化。去
/home/<username>/.gradle/ (Linux)
/Users/<username>/.gradle/ (Mac)
C:\Users\<username>\.gradle (Windows)
/home/.gradle/(Linux)
/用户//.gradle/(Mac)
C:\Users\\.gradle(Windows)
在gradle.properties文件中,删除/更改代理设置。它们与您的android studio代理设置不同
同样的问题,gradle过去需要一个小时来解决。在我从gragle.properties文件中删除代理设置后,现在需要几秒钟。您可能是在代理之后,您可能最近更改了密码,或者从设置角度看发生了一些更改。去
/home/<username>/.gradle/ (Linux)
/Users/<username>/.gradle/ (Mac)
C:\Users\<username>\.gradle (Windows)
/home/.gradle/(Linux)
/用户//.gradle/(Mac)
C:\Users\\.gradle(Windows)
在gradle.properties文件中,删除/更改代理设置。它们与您的android studio代理设置不同
同样的问题,gradle过去需要一个小时来解决。从gragle.properties文件中删除代理设置后,现在需要几秒钟。我已经提到过,它在脱机模式下构建良好,但当我因为需要新库而取消选中脱机时,需要花费大量时间。试试这个解决方案,这是其中一种方法。禁用脱机工作并没有真正的帮助。例如,我无法验证或将我的工作同步到我的远程项目,无法downloa dependencies等。我已经提到,它在脱机模式下构建良好,但当我取消选中offline时,因为我需要一个新库,这需要很多时间。试试这个解决方案,这是其中一种方法。禁用脱机工作并没有真正的帮助。例如,我无法验证或将我的工作同步到我的远程项目,无法删除依赖项等。