build.gradle

Gradle Exec task and process output

跟風遠走 提交于 2019-12-23 12:26:44
问题 I have a python script which prints some strings and updates it's execution progress in console: if __name__ == '__main__': ... print 'Hello, world!' while page <= pages: ... done = float(page) / pages sys.stdout.write('\r[{0:50s}] {1:.2f}%'.format('#' * int(done * 50), done * 100)) page += 1 print '' When I run it from console like python script.py everything is ok and I can see output and progressbar. I need to run this script as a part of Gradle build, so, I've created a task: task process

Gradle creating duplicate start scripts into bin directory

自古美人都是妖i 提交于 2019-12-23 10:16:24
问题 I am trying to create multiple start script files through gradle. But somehow one particular start script file is getting duplicated. startScripts.enabled = false run.enabled = false def createScript(project, mainClass, name) { project.tasks.create(name: name, type: CreateStartScripts) { outputDir = new File(project.buildDir, 'scripts') mainClassName = mainClass applicationName = name classpath = jar.outputs.files + project.configurations.runtime doLast { def windowsScriptFile = file

react-native run-android failed with error: Execution failed for task ':app:dexDebug'

橙三吉。 提交于 2019-12-23 09:59:55
问题 I'm using windows 8.1. with react-native-cli: 1.0.0 and react-native: 0.31.0 After adding react-native-maps to the project, I ran command react-native upgrade and given Y to all questions. Then linked deps with rnpm link as well as come changes to MainApplication.java file too. Here are changes to MainApplication.java : // Other imports ... import com.airbnb.android.react.maps.MapsPackage; public class MainApplication extends Application implements ReactApplication { private final

Could not find method exclude() for arguments [{module=support-v4}]

折月煮酒 提交于 2019-12-23 09:56:55
问题 I am trying to run my application with instant run turned off but I get this error: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/view/KeyEventCompatEclair.class Here is my gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.jua.app" minSdkVersion 16

Android Studio Error JUNIT4 !!! JUnit version 3.8 or later expected:

大兔子大兔子 提交于 2019-12-23 09:38:12
问题 I'm doing Android project (in Android Studio), with a little SDK inside that is pure java. So What I want is to do test from JUnit4. And I configured the Gradlle File in this way: apply plugin: 'android' android { compileSdkVersion "Google Inc.:Google APIs:19" buildToolsVersion "19.0.1" lintOptions{ checkReleaseBuilds false } defaultConfig { minSdkVersion 8 targetSdkVersion 19 versionCode 28 versionName "4.0.5" } signingConfigs { debug { } release { } } buildTypes { debug{ runProguard false

Gradle indentation issue in Android Studio 2.3

孤街醉人 提交于 2019-12-23 09:33:48
问题 Every time I create a new Activity in AS 2.3 it messes up the build.gradle indentation that results in errors like this. Error:Could not get unknown property 'compile' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. I have to redo the indentations every time. Any idea how to fix this permanently? 回答1: The problem seems to be caused by the lines which contain curly braces like: compile('com.github.tony19:logback-android-core:1.1.1-4') { exclude

BuildConfig variable. Error: cannot find symbol

别说谁变了你拦得住时间么 提交于 2019-12-23 09:20:07
问题 In project I have several flavors , several buildTypes and several folders for combinations Build combinations: Folder structure In each folder I have custom Application class + AndroidManifest to register this Application class Sometime, but just sometimes build fails with cannot find symbol error: \app\src\main\java\ru\my\package\app\environment\MyApp.java:35: error: cannot find symbol .core(new CrashlyticsCore.Builder().disabled(!BuildConfig.ANALYTICS).build()) or App class independent but

Exclude temporary Realm files from Gradle build

半腔热情 提交于 2019-12-23 08:50:23
问题 Realm provides a database viewer called "Realm Studio" that allows users to browse the contents of their database. When the application is used to view a database, it creates several "temporary" files in the directory of the database, namely: A .realm.lock file. A .realm.note file. A .realm.management directory containing: A access_control.control.mx file. A access_control.new_commit.cv file. A access_control.pick_writer.cv file. A access_control.write.mx file. In the context of Android, a

custom gradle plugin causes: Cannot configure the 'publishing' extension

筅森魡賤 提交于 2019-12-23 07:42:15
问题 I have a custom gradle plugin in which custom task types and gradle configurations are added. When I apply this plugin before maven-publish it works perfectly fine. But when I add it after apply plugin: 'maven-publish' , it fails with error message : FAILURE: Build failed with an exception. * Where: Build file '/scratch/skgupta/git_storage/emdi/integtest/build.gradle' line: 38 * What went wrong: A problem occurred evaluating root project 'integtest'. > Cannot configure the 'publishing'

org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'

久未见 提交于 2019-12-23 07:41:39
问题 I'm unable to build the project after updating android studio to 3.4. can anyone please help me. Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'. Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle