build.gradle

Failed to generate apk from Android studio 3.1.1

余生颓废 提交于 2019-12-18 13:01:06
问题 When I try to generate a signed APK, I found this issue : 10:58 Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view. No cached version of com.android.tools.lint:lint-gradle:26.1.1 available for offline mode. this is my android studio details : Android Studio 3.1.1 Build #AI-173.4697961, built on April 4, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 this block for signing the apk :

How to set an environment variable from a Gradle build?

£可爱£侵袭症+ 提交于 2019-12-18 12:44:46
问题 I'm trying to set an environment variable from my Gradle build. I'm on MacOS X (El Capitan). The command is "gradle test". I'm trying this in my build.gradle: task setenv(type: Exec) { commandLine "export", "SOME_TEST_VAR=aaa" } test.dependsOn setenv and the build fails: Execution failed for task ':myproject:setenv'. A problem occurred starting process 'command 'export'' I also tried this: test.doFirst { ProcessBuilder pb1 = new ProcessBuilder("export SOME_TEST_VAR=some test value") pb1.start

Gradle dependencies difference between compile, apk project, compile project,provided,implementation project

梦想与她 提交于 2019-12-18 12:40:06
问题 Gradle dependencies difference between. compile apk project compile project provided project implementation My questions are What's the difference between compile , apk project , compile project , provided project here? 回答1: There's two separate things to discuss here: Dependency Configurations and Dependency Sources. Dependency Configurations Configurations help define the transitivity of a dependency, which in turn removes the pain of having to discover and specify the libraries your own

Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$LayoutParams

ⅰ亾dé卋堺 提交于 2019-12-18 12:19:29
问题 I'm getting Multiple dex files define error in my project. I'm using these two tags in build.gradle as well dexOptions { preDexLibraries = false } defaultConfig { multiDexEnabled true } but still getting this error. Information:Gradle tasks [:app:assembleDebug] Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/design/widget/CoordinatorLayout$LayoutParams; Error:com.android.dex.DexException: Multiple dex files define

After update - Error:Failed to find: com.google.android.gms:play-services:5.2.8

僤鯓⒐⒋嵵緔 提交于 2019-12-18 12:13:53
问题 Gradle project sync failed. After update the android SDK i got this error: Error:Failed to find: com.google.android.gms:play-services:5.2.8 I have checked that the sdk location wich is updated is used by android studio I've got Google Repository installed and Android Support Repository too all up 2 date. Also i have a ANDROID_HOME local variable pointing to the sdk im actually using 回答1: try using com.google.android.gms:play-services:5.2.08 instead of 5.2.8. you can also look for the right

Android Studio: Failure [INSTALL_FAILED_USER_RESTRICTED]

♀尐吖头ヾ 提交于 2019-12-18 12:12:33
问题 I work on Android Studio with Meizu MX6 . Previously everything was ok. But it seems after updating Flyme , I started getting this problem: Failure [INSTALL_FAILED_USER_RESTRICTED] If I choose "Ok" I get next: DELETE_FAILED_INTERNAL_ERROR When I work with another smartphone all right. If I copy apk-file on my phone all right too. It installs and runs. Install software from unknown sources is on. 回答1: I had the same issue. It happens only on Flyme due to Security App. To enable installation:

Gradle does not use the Maven Local Repository for a new dependency

爱⌒轻易说出口 提交于 2019-12-18 11:41:47
问题 I have Maven with M2_HOME defined to: /Users/manuelj/apache/maven/3.2.5 I have the settings.xml file, located on: /Users/manuelj/apache/maven/3.2.5/conf/settings.xml where I have the following declared: <localRepository>/Users/manuelj/apache/maven/repository</localRepository> Until here with Maven all works fine. Any new dependency goes there. I have a project based with Gradle, among many things in my build.gradle, exists the following: apply plugin: 'java' apply plugin: 'maven' apply plugin

Disable all JavaDoc in Gradle

房东的猫 提交于 2019-12-18 11:23:05
问题 General Update, after some research I want to build my project running gradle 2.0 with gradle build in the console I get stuck at the JavaDoc generation. I'm using Java 8, precisly jdk1.8.0_66 and jre1.8.0_66 . Now when I want to build my project typing gradle build in my powershell I get this error: 5 errors 10 warnings :my-subproject1:javadoc FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':my-subproject1:javadoc'. > Javadoc generation failed.

Disable all JavaDoc in Gradle

只愿长相守 提交于 2019-12-18 11:22:06
问题 General Update, after some research I want to build my project running gradle 2.0 with gradle build in the console I get stuck at the JavaDoc generation. I'm using Java 8, precisly jdk1.8.0_66 and jre1.8.0_66 . Now when I want to build my project typing gradle build in my powershell I get this error: 5 errors 10 warnings :my-subproject1:javadoc FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':my-subproject1:javadoc'. > Javadoc generation failed.

Gradle: Exclude file from Android assets folder

有些话、适合烂在心里 提交于 2019-12-18 11:04:10
问题 Please, do you know a way how to exclude some file from Android project assets folder before multiple assets folders are merged or during the merge? For example: android { sourceSets { main { assets.srcDirs = [fileTree(dir: 'assets1', exclude: 'myfile.txt'), 'assets2'] // does not work assets.exclude 'assets1/myfile.txt' // does not work assets.exclude '**/*.txt' // does not work assets.exclude '*.txt' // does not work } } packagingOptions { exclude 'assets1/myfile.txt' // does not work