android-gradle

Android Studio: Gradle sync failed: Could not HEAD '…'. Received status code 502 from server: Bad Gateway [closed]

僤鯓⒐⒋嵵緔 提交于 2019-11-26 17:44:08
After update Android Studio to latest version (3.1) and gradle version in my project I get an error (the link is always different): 12:54 Gradle sync started 12:56 Gradle sync failed: Could not HEAD 'https://jcenter.bintray.com/com/android/tools/analytics-library/shared/26.1.0/shared-26.1.0.jar'. Received status code 502 from server: Bad Gateway Consult IDE log for more details (Help | Show Log) (1m 56s 602ms) 12:56 Gradle sync started 12:57 Gradle sync failed: Could not HEAD 'https://jcenter.bintray.com/org/codehaus/mojo/animal-sniffer-parent/1.14/animal-sniffer-parent-1.14.pom'. Received

How to configure gradle to work “offline” (using cached dependencies)

心不动则不痛 提交于 2019-11-26 17:42:55
I have a command line apk generator which compiles a lot of APKs using the same source code, so these apps have the same dependencies. In the gradle documentation I can see this: The Gradle project needs network connectivity to download dependencies. I know that it is possible to configure gradle to work offline and not download the same dependencies that it has downloaded for other apks. How can this offline mode be activated? Gradle does a good job of avoiding redownloading artifacts, but you can pass --offline to grade to prevent from accessing the network during builds. If it needs

Android Studio 3.1 “Run” not compiling code

半城伤御伤魂 提交于 2019-11-26 17:34:29
When I try to install an app, there are two possibilities: Install existing APK from build folder when I run the app Install APK after performing clean build For existing APK in the build folder, the app just works fine. But when I clean the project using Build -> Clean Project , and then try to run the app (i.e. install the app to my emulator or physical device), it shows me error: The APK file /Users/MyApplicationName/app/build/outputs/apk/app-debug.apk does not exist on disk. NOTE: This behaviour happens only when I clean the project and not when I have already have a pre-built app APK in

Duplicate files copied (Android Studio 0.4.0) [duplicate]

坚强是说给别人听的谎言 提交于 2019-11-26 17:17:47
This question already has an answer here: Android Gradle plugin 0.7.0: “duplicate files during packaging of APK” 20 answers In my project I use httpcore and httpmime libraries from Apache. After update Android Studio to 0.4.0 I have this issue building my project: Duplicate files copied in APK META-INF/DEPENDENCIES File 1: /home/slava/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1/f7899276dddd01d8a42ecfe27e7031fcf9824422/httpmime-4.3.1.jar File 2: /home/slava/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.3.1

Error :: duplicate files during packaging of APK

泪湿孤枕 提交于 2019-11-26 17:17:41
Android Studio. I'm getting this kind of error during application run. Error:Execution failed for task ':app:packageDebug'. Duplicate files copied in APK META-INF/notice.txt build.gradle apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion "19.0.1" packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/ASL2.0' } defaultConfig { minSdkVersion 7 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

☆樱花仙子☆ 提交于 2019-11-26 16:53:42
I want to compile an open source android project (Netguard) using gradel ( gradlew clean build ) But I encountered this Error: A problem occurred configuring project ':app'. > Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#cre ateToolchains > No toolchains found in the NDK toolchains folder for ABI with prefix: llvm I serached but didn't find enything helping. Here is the main build.gradle : buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha1' } } allprojects { repositories { jcenter() } } task

Dex error On Android Studio 3.0 Beta4

99封情书 提交于 2019-11-26 16:35:36
Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:com.android.dex.DexException: Multiple dex files define Lcom/google/zxing/integration/android/IntentResult; I have same problem with Android Studio 3.0 beta 4. I found a solution. 1. From the Build menu, press the Clean Project button. 2. After task completed, press the

Error:(26, 0) Gradle DSL method not found: 'runProguard()'

[亡魂溺海] 提交于 2019-11-26 15:50:45
I'm using android studio 0.9.3 with gradle 'com.android.tools.build:gradle:0.14.+' apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion '20.0.0' defaultConfig { applicationId "xxx.xxx.xxx" minSdkVersion 16 targetSdkVersion 19 versionCode 1 versionName "1.0.11" } signingConfigs{ releaseConfig{ storeFile file("xxxxxxx") storePassword = "xxxx" keyAlias = "xxxx" keyPassword = "xxxx" } } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.releaseConfig // adds

Multi flavor app based on multi flavor library in Android Gradle

拈花ヽ惹草 提交于 2019-11-26 15:38:40
My app has several flavors for several markets in-app-billing systems. I have a single library which shares the base code for all of my projects. So I decided to add those payment systems to this library as product flavors. The question is can android library have product flavors? If so, how can I include different flavors in respective flavor of the app? I searched a lot, and I couldn't find anything about this scenario. The only close thing I found was this in http://tools.android.com/tech-docs/new-build-system/user-guide : dependencies { flavor1Compile project(path: ':lib1', configuration:

Google material design library error Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

半城伤御伤魂 提交于 2019-11-26 15:23:57
Whenever i add implemntation 'com.google.android.material:material:1.0.0-alpha1' when i try to build my project Android Studio says: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy Message{kind=ERROR, text=Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy, sources=[Unknown source file], tool name=Optional.of(D8)} This is my gradle script: apply plugin: 'com.android.application' android { compileSdkVersion 'android-P' defaultConfig { applicationId "it.smart.bab3" minSdkVersion 21 targetSdkVersion 'p' versionCode 1