如果发现构建出错,mac和linux请在terminal下执行
./gradlew assembleDebug --stacktrace (如果你studio里当前的variant是release,那就执行./gradlew assembleRelease --stacktrace ,如果是别的同理)
如果是windows执行gradlew.bat assembleDebug --stacktrace
然后把所有的日志输出、android gradle版本后、你的操作系统贴到issue里,贴出的信息越多就越利于找问题
例如:
操作系统: mac
android gradle-build: 2.1.2
gradle: 2.10
Parallel execution is an incubating feature.
:gradle-plugin:compileJava UP-TO-DATE
:gradle-plugin:compileGroovy UP-TO-DATE
:gradle-plugin:processResources UP-TO-DATE
:gradle-plugin:classes UP-TO-DATE
:gradle-plugin:jar UP-TO-DATE
:gradle-plugin:assemble UP-TO-DATE
:gradle-plugin:compileTestJava UP-TO-DATE
:gradle-plugin:compileTestGroovy UP-TO-DATE
:gradle-plugin:processTestResources UP-TO-DATE
:gradle-plugin:testClasses UP-TO-DATE
:gradle-plugin:test UP-TO-DATE
:gradle-plugin:check UP-TO-DATE
:gradle-plugin:build UP-TO-DATE
Incremental java compilation is an incubating feature.
==fastdex disable fastdex [android.buildTypesBuildType_Decorated{name=product, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, versionNameSuffix=null, minifyEnabled=true, zipAlignEnabled=true, signingConfig=SigningConfig_Decorated{name=config, storeFile=/Users/tong/Projects/fastdex/keystore.jks, storePassword=testres, keyAlias=testres, keyPassword=testres, storeType=/Users/tong/Projects/fastdex/keystore.jks}, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.minifyEnabled=true]
==fastdex find dex transform. transform class: class com.android.build.gradle.internal.transforms.DexTransform . task name: transformClassesWithDexForDebug
:runtime:preBuild
:app:preBuild UP-TO-DATE
:runtime:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:runtime:preDebugBuild
:app:checkDebugManifest
:runtime:preDebugBuild UP-TO-DATE
:app:preProductBuild UP-TO-DATE
:runtime:compileDebugNdk
:app:preReleaseBuild UP-TO-DATE
:runtime:compileDebugNdk UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library
:runtime:compileLint
:runtime:copyDebugLint UP-TO-DATE
:runtime:mergeDebugProguardFiles UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:runtime:packageDebugRenderscript UP-TO-DATE
:app:prepareComJakewhartonButterknife801Library
:runtime:checkDebugManifest
:runtime:prepareDebugDependencies
:app:prepareComJakewhartonButterknife801Library UP-TO-DATE
:runtime:compileDebugRenderscript
:app:prepareComSquareupLeakcanaryLeakcanaryAndroid14Beta2Library UP-TO-DATE
:app:prepareIoReactivexRxandroid120Library
:runtime:compileDebugRenderscript UP-TO-DATE
:runtime:generateDebugResValues
:app:prepareIoReactivexRxandroid120Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:runtime:generateDebugResValues UP-TO-DATE
:runtime:generateDebugResources UP-TO-DATE
:runtime:packageDebugResources
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig
:runtime:packageDebugResources UP-TO-DATE
:runtime:compileDebugAidl UP-TO-DATE
:runtime:generateDebugBuildConfig
:app:generateDebugBuildConfig UP-TO-DATE
:app:processDebugManifest
:runtime:generateDebugBuildConfig UP-TO-DATE
:runtime:mergeDebugShaders UP-TO-DATE
:runtime:compileDebugShaders UP-TO-DATE
:runtime:generateDebugAssets UP-TO-DATE
:runtime:mergeDebugAssets UP-TO-DATE
:runtime:processDebugManifest UP-TO-DATE
:runtime:processDebugResources UP-TO-DATE
:runtime:generateDebugSources UP-TO-DATE
:runtime:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:runtime:compileDebugJavaWithJavac UP-TO-DATE
:runtime:processDebugJavaRes UP-TO-DATE
:runtime:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:runtime:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:runtime:mergeDebugJniLibFolders UP-TO-DATE
:runtime:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:runtime:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:runtime:bundleDebug UP-TO-DATE
:runtime:compileDebugSources UP-TO-DATE
:runtime:assembleDebug UP-TO-DATE
:app:fastdexProcessDebugManifest
fastdex gen AndroidManifest.xml in AndroidManifest.xml
:app:fastdexProcessDebugResourceId
==fastdex public xml file and ids xml file already exist, just ignore
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:fastdexCustomCompileDebugJavaWithJavac
==fastdex discover cached for debug
==fastdex diff dir: /Users/tong/Projects/fastdex/app/src/main/java /Users/tong/Projects/fastdex/app/build/fastdex/Debug/snapshoot/763df05f72724da457aef7e01c5c9f14
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
注: 某些输入文件使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:prePackageMarkerForDebug
:app:transformClassesWithJarMergingForDebug
:app:collectDebugMultiDexComponents
:app:fastdexCreateDebugMaindexlistFileTask
:app:transformClassesWithMultidexlistForDebug SKIPPED
:app:transformClassesWithDexForDebug
==fastdex diff dir: /Users/tong/Projects/fastdex/app/src/main/java /Users/tong/Projects/fastdex/app/build/fastdex/Debug/snapshoot/763df05f72724da457aef7e01c5c9f14
==fastdex will generate dex file [com/dx168/fastdex/sample/BuildConfig.class]
==fastdex generate dex cmd
/Users/tong/Applications/android-sdk-macosx/build-tools/23.0.1/dx --dex --output=/Users/tong/Projects/fastdex/app/build/fastdex/Debug/patch.dex /Users/tong/Projects/fastdex/app/build/fastdex/Debug/patch-combined.jar
==fastdex generate dex success: /Users/tong/Projects/fastdex/app/build/fastdex/Debug/patch.dex
==fastdex patch build cached_dex[classes.dex,classes2.dex] cur-dex[classes.dex,classes2.dex,classes3.dex,classes4.dex]
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateConfigSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
BUILD SUCCESSFUL
Total time: 15.08 secs