android-gradle

Android Studio 0.5.2 Gradle Refresh Project failed

为君一笑 提交于 2019-11-28 23:38:56
UPDATED WITH MY EVENT LOG LAST EDIT After trying out every possible solution i could find i've come to a fresh install of Windows. Doing this i noticed that this was indeeed a firewall issue, my antivirus was blocking the studio64.exe process. I have freshly installed Android Studio 0.4.2 then immediately updated to 0.5.2 without opening or creating any new projects. I updated the Android SDK then created a new project. I keep getting the error with the Gradle Refresh Failed even though i tried to change the local gradle distribution, nothing seems to work, everything i try Gradle replies with

Jvm options in android when run gradlew test

纵饮孤独 提交于 2019-11-28 23:33:39
I have a project that using Robolectric for unit test purpose. This project uses Robolectric 3.0 and need to add -ea and -noverify options in Virtual Machine options. In Android Studio, I created new JUnit configuration in Run > Edit Configurations... and then set VM Options to -ea -noverify . With this way I success to run my unit test. This is image about my configure, view Here However, for continuous deployment, I need run unit test with command line. So I use ./gradlew test to run unit test. I also add org.gradle.jvmargs=-ea -noverify to gradle.properties file. Unfortunately, it doesn't

Gradle: how do I include a local jar from a dependent java project in an Android build?

妖精的绣舞 提交于 2019-11-28 23:32:38
In my Android app, I'm getting a java.lang.NoClassDefFoundError when the code that references code in a dependent .jar is executed. My project includes an Android module as well as a java-only library module, which is where the jar dependency is. I'm using gradle 1.10 to build the project. Here is my project layout: myProject - app (Android) - src - build.gradle - lib (java) - src - libs - local-dependency.jar - build.gradle - build.gradle - settings.gradle The main project build.gradle is blank while the main project settings.gradle looks like: include ':app', ':lib' The Android app build

NoClassDefFoundError android/support/v4/animation/AnimatorCompatHelper

半城伤御伤魂 提交于 2019-11-28 23:29:28
After updating Android Studio to 2.3.1 and gradle to 3.3 i noticed that the app is crashing on a certain activity. Before the update, everything was fine. I've wasted a day on this thing and I really can't seem to figure out why I'm getting a 'java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/animation/AnimatorCompatHelper;' fatal exception. I'll upload also the most important parts of the build.gradle file apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion ANDROID_BUILD_TOOLS defaultConfig { minSdkVersion 16 targetSdkVersion

Android studio broke up my build.gradle file after add a Fragment

泪湿孤枕 提交于 2019-11-28 23:10:29
Using Android Studio 2.0 over El Capitan like the next screenshot said: I found a bug that I can't report: After add a Fragment to my project, AS screw up my module build.gradle file. I mean, before add the fragment they file looks like this screenshot: but after add the Fragment AS screw it in this way: The way to reproduce it is like I'm showing in next screenshot: I can fix it manually, but its so annoying doing it every single time that I add a Fragment. Is there anyway to fix it? I'm on Mac OX with El Capitan. afj88 It is a still open bug, you can monitor it's state here The bug is due to

Wear App and with custom build type with applicationIdSuffix

这一生的挚爱 提交于 2019-11-28 23:04:01
I have an app where I'd like to add an Android Wear app extension. The main app has three build types (debug, beta and release). Beta builds have an applicationIdSuffix which allows me to install the play-store version and the current development version in parallel on the same device. This all worked fine until I added the wear app. The main app`s build.gradle looks like this: apply plugin: 'com.android.application' android { ... defaultConfig { ... applicationId "com.example.mainApp" ... } buildTypes { debug { applicationIdSuffix '.debug' } beta { applicationIdSuffix '.beta' } release { } }

How to provide different launcher icon per product flavour

前提是你 提交于 2019-11-28 22:51:43
I have a project defined by build.gradle file buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.6' } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['resources'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } instrumentTest.setRoot('tests') } defaultConfig { ... } signingConfigs

Gradle sync fails - play-services-measurement-base

二次信任 提交于 2019-11-28 22:24:48
I have a problem on my Android project, I can't build, this is the error I have: Failed to notify dependency resolution listener. The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2], [15.0.4,15.0.4]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. I tried many different solution I found but the problem persists. I have the right dependencies and repositories on gradle file on project root: dependencies { classpath 'com.android.tools.build:gradle:3.1.2'

Using Android Studio how do I get a signed, non-debug and zip aligned APK?

会有一股神秘感。 提交于 2019-11-28 22:08:35
Using Android Studio how do I get a signed, non-debug and zip aligned APK? So far I can get a signed one but it gets rejected because it has debugging in it. I can get a non debug release apk but it gets rejected because it's not zip aligned. I can zip align it but then I can't upload it because that one is not signed. Edit: I should mention that I'm on windows. Most everything I've looked at is linux based and difficult to separate linux paths from config paths. Edit2: Things are on hold at the moment. I updated Android Studio and that killed everything because it comes with gradle 1.9

Android: Using SVG in res leads to error: “The file name must end with .xml or .png”

北战南征 提交于 2019-11-28 21:35:33
I just updated Android Studio 1.2.1.1 and now gradle got problems with svg in my resources folder. I was always using SVGs with no problem and I hope they will be "allowed" in the future. :app:mergeDebugResources :app:mergeDebugResources FAILED /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg Error:Error: The file name must end with .xml or .png Error:Execution failed for task ':app:mergeDebugResources'. > /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg: Error: The file name must end with .xml or .png