build.gradle

Change apk output folder in Gradle 4.1

纵然是瞬间 提交于 2019-12-03 05:55:05
问题 I would like to change the APK output folder and this is what I used to do: applicationVariants.all { variant -> variant.outputs.all { def filePath = "${rootProject.rootDir.absolutePath}/apks/${variant.name}" println("My Path: " + filePath) outputFileName = filePath } } However, it didn't work in Gradle 4.1 (Android studio 3.0 preview). Instead of generating the folder as the path above, it generated the above path inside old debug folder like image below: Does anyone have a solution for this

Could not find com.android.support:support-v4:22.0.0. after SDK update

蹲街弑〆低调 提交于 2019-12-03 05:44:23
After the sdk update im not able to create a hello world application. My build.gradle looks like this apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.coders.yo" minSdkVersion 11 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' } But build got failed and shows Error

Add productFlavor to experimental Android gradle plugin library

元气小坏坏 提交于 2019-12-03 05:40:58
I've got a project that uses the experimental gradle plugin, i.e. 0.2.0 . When I've got no productFlavor , I can perfectly integrate a library module in Android Studio and everything works perfectly. But when the library has a productFlavor , I main project doesn't find the library classes. This fix does not appear to work with the experimental gradle plugin. Does anyone have any idea how make flavors work with the new plugin? Library: android.productFlavor { create ('flavor') { ... } } Project: ... dependencies { compile project(':mylibrary') } MaTriXy This might help? Library Publication By

How to pass multiple parameters in command line when running gradle task?

本小妞迷上赌 提交于 2019-12-03 05:25:35
I've got a java and groovy classes that are being run by gradle task. I have managed to make it work but I do not like the way I have to pass the parameters in command line. Here is how I do it currently via command line: gradle runTask -Pmode"['doStuff','username','password']" my build.gradle code which takes these parameters looks like this: if (project.hasProperty("mode")) { args Eval.me(mode)} and then I use my arguments/parameters in my java code as follows: String action = args[0]; //"doStuff" String name = args[1]; .. //"username" I was wondering is there a way to pass the parameters in

Setting Up the Licensing Verification Library on Android Studio

巧了我就是萌 提交于 2019-12-03 04:14:34
问题 im'triyng to implement the Google Licensing Verification in a Android Studio made app. By following this lines: http://developer.android.com/google/play/licensing/setting-up.html seems tath: As an alternative to adding the LVL as a library project, you can copy the library sources directly into your application. To do so, copy (or import) the LVL's library/src/com directory into your application's src/ directory. I've done this but the import of: import com.google.android.vending.licensing

Configure Gradle to execute custom build step before starting compilation

白昼怎懂夜的黑 提交于 2019-12-03 03:38:51
I've started using Gradle today and after searching for an hour and trying every possible answer from SO (e.g. 1 ) and different blogs (e.g. 2 ) and documentations (e.g. 3 ) I need some help. My question is simple: How to execute a custom build-step (in my case the execution of ndk-build with a customized Android.mk) as part of the regular build-process? The build.gradle looks like this: import org.apache.tools.ant.taskdefs.condition.Os apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion "21.1.2" defaultConfig { applicationId "myApp.prototype" minSdkVersion

Unable to compile my android project

会有一股神秘感。 提交于 2019-12-03 03:27:13
When i try to compile my android project iam getting the following error. Error:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find com.android.support:appcompat-v7:21.0.1. Searched in the following locations: https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.jar file:/home/baman/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.1/appcompat-v7-21.0.1.pom

Android gradle task Google Appengine

两盒软妹~` 提交于 2019-12-03 03:22:30
I'm trying to write a gradle task for my android application that starts the google appengine developer server, runs a test, and then closes the server. What I've tried so far looks like this: task runAppEngine (dependsOn: ":backend:appengineRun") <<{ //run test //stop development server } The appengineRun task runs, but whatever I put in the doLast section of the gradle task never seems to get executed. For example if I put in a println statement it is never printed to the console. I'm also not sure how to go about calling appengineStop from the task to stop the development server as well.

React Native Android Release Build Failing - Gradle

送分小仙女□ 提交于 2019-12-03 02:59:32
I've got a rather complicated project some of which is older code from the past year or so which in React Native time is forever. The regular debug build is working fine but the release build has errors. I've cobbled together answers from other places to make it as far as I have but I don't know how to get past this last bit. I keep getting a bundling error where aapt will fail because it doesn't bundle the resources properly. Example of error code: > Task :app:bundleReleaseJsAndAssets Scanning folders for symlinks in /media/user/1546c7ef-f386-4baa-90d5-cbd87092d3e31/home/user/Code/React

com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed after updating android studio

放肆的年华 提交于 2019-12-03 02:47:49
After updating android studio,i am getting this error.how to fix this?? org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures. at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:358) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:300) at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:292) at org.gradle.internal.operations.DefaultBuildOperationExecutor