我尝试运行我的应用程序的构建并在我的bitbucket帐户上执行带有CI圈的espresso测试但是我得到了超时(我已经增加到2h并且它仍然无法工作)并且gradle stop on
> Building 63%> Building 64% > :app:transformClassesWithDexForDebug
command ./gradlew connectedAndroidTest -PdisablePreDex took more than 120 minutes to run
我已经尝试过在互联网上找到的几种解决方案,但没有人帮助过我.....我想说明我的电脑上的buid工作得很好(ArchLinux和Windows 10)
我的圈子。
#
# Build configuration for Circle CI
#
general:
build_dir: my_app
machine:
environment:
ANDROID_HOME: /usr/local/android-sdk-linux
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
_JAVA_OPTIONS: "-Xms512m -Xmx1024m -XX:-UseGCOverheadLimit"
ADB_INSTALL_TIMEOUT: "20"
ANDROID_API_LEVEL: 25
ANDROID_BUILD_TOOLS_VERSION: 25.0.3
dependencies:
cache_directories:
- ~/.gradle
- ~/.android
- /usr/local/android-sdk-linux/extras
pre:
- if [ ! -d "$ANDROID_HOME/tools" ]; then echo y | android update sdk --no-ui --all --filter "tools"; fi
- if [ ! -d "$ANDROID_HOME/platforms/android-$ANDROID_API_LEVEL" ]; then echo y | android update sdk --no-ui --all --filter "android-$ANDROID_API_LEVEL"; fi
- if [ ! -d "$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION" ]; then echo y | android update sdk --no-ui --all --filter "build-tools-$ANDROID_BUILD_TOOLS_VERSION"; fi
- if [ ! -d "$ANDROID_HOME/add-ons/addon-google_apis-google-$ANDROID_API_LEVEL" ]; then echo y | android update sdk --no-ui --all --filter "addon-google_apis-google-$ANDROID_API_LEVEL"; fi
- echo y | android update sdk --no-ui --all --filter "extra-google-m2repository"
- echo y | android update sdk --no-ui --all --filter "extra-google-google_play_services"
- echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"
# Android Tools latest (has sdkmanager)
- if [ ! -d "$ANDROID_HOME/tools/bin/sdkmanager" ]; then echo y | android update sdk --no-ui --all --filter "tools"; fi
# ConstraintLayout
- if [ ! -d "$ANDROID_HOME/extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2" ]; then echo y | /usr/local/android-sdk-linux/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"; fi
# ConstraintLayout Solver
- if [ ! -d "$ANDROID_HOME/extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2" ]; then echo y | /usr/local/android-sdk-linux/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"; fi
- chmod +x gradlew
override:
- ANDROID_HOME=/usr/local/android-sdk-linux ./gradlew dependencies
test:
override:
# start the emulator
- emulator -avd circleci-android24 -no-window -gpu off:
background: true
parallel: true
# wait for it to have booted
- circle-android wait-for-boot
# unlock the emulator screen
- sleep 30
- adb shell input keyevent 82
# run tests against the emulator.
- echo $PATH
- ls
- ./gradlew connectedAndroidTest -PdisablePreDex:
timeout: 7200
# copy the build outputs to artifacts
- cp -r app/build/outputs $CIRCLE_ARTIFACTS
# copy the test results to the test results directory.
- cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS
我的build.gradle(app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
android {
applicationVariants.all { variant ->
variant.outputs.each { output ->
//On renome le fichier mapping de proguard
if (variant.getBuildType().isMinifyEnabled()) {
variant.assemble.doLast {
copy {
from variant.mappingFile
into output.outputFile.parent + "/mapping"
rename { String fileName ->
"mapping-${variant.name}-${variant.versionCode}-${new Date().format('yyyy_MM_dd')}.txt"
}
}
}
}
//Renomage du fichier de sortie
output.outputFile = new File(
output.outputFile.parent,
output.outputFile.name.replace("app-${variant.name}.apk", "app-${variant.name}-${variant.versionCode}.apk")
)
}
}
signingConfigs {
Keys {
private
}
}
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.me.app"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
signingConfig signingConfigs.Keys
}
debug {
signingConfig signingConfigs.Keys
}
}
dexOptions {
jumboMode = true
}
}
setProperty("FirebaseServiceAccountFilePath", rootProject.rootDir.absolutePath + FirebaseServiceAccountFilePath)
repositories {
jcenter()
}
repositories {
maven { url "http://repo1.maven.org/maven2" }
maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:customtabs:25.3.1'
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.github.markushi:circlebutton:1.1'
compile 'com.github.daniel-stoneuk:material-about-library:1.8.2'
compile 'com.afollestad.material-dialogs:core:0.9.4.3'
compile 'com.afollestad.material-dialogs:commons:0.9.4.3'
//firebase
compile 'com.google.firebase:firebase-ads:10.2.6'
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.google.firebase:firebase-crash:10.2.6'
compile 'com.google.firebase:firebase-messaging:10.2.6'
compile 'com.google.firebase:firebase-auth:10.2.6'
compile 'com.google.firebase:firebase-database:10.2.6'
compile 'com.google.firebase:firebase-config:10.2.6'
compile 'com.google.firebase:firebase-storage:10.2.6'
compile 'com.google.firebase:firebase-perf:10.2.6'
compile 'com.google.firebase:firebase-invites:10.2.6'
compile 'com.firebaseui:firebase-ui-auth:1.2.0'
//Fabric
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
//Achat in app
//noinspection GradleDynamicVersion
compile 'com.anjlab.android.iab.v3:library:1.0.+'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'commons-io:commons-io:2.5'
compile 'com.github.iammert:MaterialIntroView:1.6.0'
//Onglet
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
//Graphique
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
//Divers
compile 'com.google.code.gson:gson:2.7'
compile 'com.facebook.stetho:stetho:1.4.2'
//LeakCanary
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
//Sécurité de l'appli
compile 'com.github.javiersantos:PiracyChecker:1.0.2'
//Recuperer les infos du playstore
compile 'com.andrognito.rxmagneto:rxmagneto:1.0.0'
compile 'io.reactivex:rxjava:1.2.7'
compile 'io.reactivex:rxandroid:1.1.0'
// compile 'com.artemzin.rxjava:proguard-rules:1.2.7.0'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.3-alpha', {
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.3-alpha', {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
//SqlScout
compile 'com.idescout.sql:sqlscout-server:2.0'
//Animation liste
compile 'com.willowtreeapps.spruce:spruce-android:1.0.1'
//Overlay
debugCompile 'com.ms-square:debugoverlay:1.0.1'
releaseCompile 'com.ms-square:debugoverlay-no-op:1.0.1'
testCompile 'com.ms-square:debugoverlay-no-op:1.0.1'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'