Tag: gradle

如何将Maven构build转换为Gradle?

我知道我应该与我的build.gradle和init.gradle文件,但我不知道该写什么或如何指向我的项目文件夹与pom.xml文件。

testing工件select器丢失/从Android Studio 2 Beta 5中的生成变体

为了从Android Studio中运行Instrumentationtesting,我通常通过Build Variants窗口select“Android Instrumentation Tests”作为要构build的testing工件。 我最近升级到Android Studio 2 Beta 5,并且“Test Artifact”select器不再可见。 它去了哪里? 是否有其他configuration取而代之?

在命令行上使用Gradle生成一个android studio项目失败:Xlint错误

当我尝试用这个命令用gradlebuild立一个android项目时: > gradlew clean build assembleRelease 它给了我这个错误: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 我可以build立这个项目,并在Studio中制作APK。 有没有办法configurationGradle来编译忽略Xlint通知的编译? 或者,我可以使用其他参数,使用gradle / gradlew从命令行释放?

Android Gradle使用子项目进行构build

我目前正在将我们的一个项目从maven转换为Gradle。 文件夹结构如下: gitRoot settings.gradle build.gradle ProjectA build.gradle src/main/java Libraries SomeLib (git submodule) ProjectBRoot (git submodule) settings.gradle build.gradle ProjectB build.gradle src/main/java Libraries FacebookSDK/facebook build.gradle src 所以看起来很复杂。 但是,这个想法是ProjectB是一个图书馆项目,它应该能够分别build立和打包,这就是为什么它有自己的settings.gradle和据我所知,似乎工作正常,我build设它的发现Facebook就好了。 ProjectB / build.gradle包含这一行 compile project(':libraries:facebook-android-sdk:facebook') ProjectBRoot / settings.gradle包含这一行 include ':ProjectB', ':libraries:facebook-android-sdk:facebook' gitRoot / settings.gradle包含这一行 include ':ProjectA', ':Libraries:ProjectBRoot:ProjectB' ProjectA / build.gradle包含这一行 compile project(':Libraries:ProjectBRoot:ProjectB') 当我运行生成我得到这个错误 The TaskContainer.add() method has been deprecated […]

如何设置gradle和android studio来进行发布构build?

我想要构buildAndroid应用程序并开始签名。 为此,我需要有发布版本的apk。 谷歌文档build议只有Eclipse和ant的方式来发布版本: http : //developer.android.com/tools/publishing/app-signing.html#releasecompile 不过我找不到如何强制gradle build版本的apk。 build.gradle不给任何提示。 gradlew tasksbuild议,没有安装Releaseconfiguration,但存在卸载版本: Install tasks ————- installDebug – Installs the Debug build installTest – Installs the Test build for the Debug build uninstallAll – Uninstall all applications. uninstallDebug – Uninstalls the Debug build uninstallRelease – Uninstalls the Release build uninstallTest – Uninstalls the Test build for the […]

在eclipse中更新我的gradle依赖关系

我在eclipse中有一个简单的gradle项目。 我更新build.gradle包括几个Apache HTTPjar子… dependencies { compile group: 'commons-collections', name: 'commons-collections', version: '3.2' compile 'org.apache.httpcomponents:httpclient:4.2.3' compile "org.apache.httpcomponents:httpmime:4.2.3" testCompile group: 'junit', name: 'junit', version: '4.+' } 但是在我的代码中,我引用了一些Apache HTTP的东西: The import org.apache.http cannot be resolved 任何提示,我需要做什么,使Eclipse看到我的build.gradle新的依赖关系? 我试图做一个干净的,但是这是行不通的。 我的gradle插件是: Gradle IDE 3.3.0.201307040643-RELEASE org.springsource.ide.eclipse.gradle.feature.feature.group GoPivotal, Inc.

java.lang.NullPointerException(无错误消息)

我知道我的这个问题已经被问了很多次了,我确实遵循了大部分的答案,但是没有一个帮助我。 所以这是我的问题,每当我同步我的项目总是失败。 以下是Gradle控制台的外观: 执行任务:[:app:generateDebugSources,:app:generateDebugAndroidTestSources,:app:mockableAndroidJar,:app:prepareDebugUnitTestDependencies] 按需configuration是一项孵化function。 增量Java编译是一个孵化function。 :app:preBuild最新date:app:preDebugBuild最新date:app:checkDebugManifest:app:preReleaseBuild UP-TO-DATE:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library最新date:app:prepareComAndroidSupportAppcompatV72420Library最新date: app:prepareComAndroidSupportDesign2420Library UP-TO-DATE:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE:app:prepareComAndroidSupportRecyclerviewV72420Library UP-TO-DATE:app:prepareComAndroidSupportSupportCompat2420Library UP-TO-DATE:app:prepareComAndroidSupportSupportCoreUi2420Library UP-TO-DATE:app:prepareComAndroidSupportSupportCoreUtils2420Library UP- TO-DATE:app:prepareComAndroidSupportSupportFragment2420Library UP-TO-DATE:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE:app:prepareComAndroidSupportSupportMediaCompat2420Library UP-TO-DATE:app:prepareComAndroidSupportSupportV42420Library UP-TO-DATE:app:prepareComAndroidSupportSupportVectorDrawable2420Library UP-TO-DATE:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE:app :prepareComGoogleAndroidG msPlayServicesAds940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-date:应用:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library最新date:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library最新date:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE:app :prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE:应用:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE:应用程序:prepareComGoogleAndroidGmsPlayServicesIdentity940Library失败:build立失败,例外。 出了什么问题:java.lang.NullPointerException(无错误消息) 尝试:运行–stacktrace选项来获取堆栈跟踪。 运行–info或–debug选项来获得更多的日志输出。 构build失败 总时间:7.518秒 这些是我的依赖 dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) […]

执行失败的任务:在Android Studio中的应用程序:compileDebugJavaWithJavac

我正在Android Studio中开发一个Android应用程序。 不太清楚哪里出了问题。 前几天我成功build设了。 任何帮助将是伟大的。 这是错误: Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. 这是我的build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "21.1.2" defaultConfig { multiDexEnabled true applicationId […]

未find名称为“default”的configuration。 Android Studio

我有一个Android Studio应用程序。 它有一个库依赖(Android的Bootstrap),当我尝试同步gradle,说我错误: 未find名称为“default”的configuration。 我的结构是: -FTPBackup -fotobackup -build.gradle -Libraries -Android-Bootstrap -Settings.gradle -build.gradle -Settings.gradle -Build.gradle FTPBackup settings.gradle和build.gradle: include ':fotobackup' include ':libraries:Android-Bootstrap',':Android-Bootstrap' // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } allprojects { repositories { mavenCentral() } } 而fotobackup里面的build.gradle是: apply […]

在Android和Gradle中使用SimpleXML

我遇到了麻烦,试图用Gradle 0.5。+和Android Studio编译Android应用程序,使用SimpleXML。 这是错误的: Gradle: Execution failed for task ':MyApplication:dexDebug'. > Failed to run command: /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/dx –dex –output <REALLY_LONG_STRING…..> Error Code: 1 Output: trouble processing "javax/xml/stream/events/StartElement.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a core library file […]