android-gradle

Android Gradle cannot find symbol class Gson

那年仲夏 提交于 2019-11-28 06:42:00
So i added gson-2.2.4.jar to the libs dir (I'm using android studio). My project couldn't find the gson stuff so I added it as a library dependency to my module in the "Project Structure". When I try to run the project, the build is failing with the following errors: Error:(12, 23) Gradle: package com.google.gson does not exist Error:(37, 3) Gradle: cannot find symbol class Gson Error:(37, 19) Gradle: cannot find symbol class Gson Why can't I get this working? I read elsewhere that gradle is supposed to handle everything automatically if it's put in the lib dir. Adding it as a dependency in

buildConfigField depending on flavor + buildType

陌路散爱 提交于 2019-11-28 06:30:56
I'm trying to define a buildConfigVariable depending on the flavor + buildType . Ideally, this is what I want productFlavors { strawberry { buildConfigField "String", "WS_API_KEY", name + variant.buildType.name } ... more flavors .. } name does contain "strawberry", but I don't know if it's possible to access the variant 's buildType . Placed outside the Android closure I do have access to the BuildType and variant , but then I can't invoke buildConfigField android.applicationVariants.all { variant -> println "****************************" println "variant: ${variant.name}" println "flavor: $

Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes - Android studio 2.0 beta 6

佐手、 提交于 2019-11-28 06:22:51
I updated to the last version of Android studio 2.0 Beta 6 with the gradle : dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta6' } The app works perfectly fine on emulator and devices I tested every thing and it works fine. I got many errors only when I try to Generate Signed APK, I got some errors in dependencies, all of them solved when i excluded vector drawable, vector animate drawable and Support-v4 library Now i dont have any dependencies error. now my gradle.build for the app module looks like this: apply plugin: 'com.android.application' android { configurations { /

Cordova build changes distributionUrl in gradle-wrapper.properties file

浪子不回头ぞ 提交于 2019-11-28 06:18:12
I keep getting the following build exception when I run cordova run android --verbose What went wrong: A problem occurred evaluating root project 'android'. Failed to apply plugin [id 'android'] Gradle version 2.10 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Project\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip The reason for this is the line being changed when I run the cordova build command from; distributionUrl=http\://services.gradle.org/distributions/gradle-2.1.0-all.zip to distributionUrl=http\:/

Could not get resource 'http://…firebase-measurement-connector-impl-17.0.5-javadoc.jar

烂漫一生 提交于 2019-11-28 06:10:30
I got this error after updating library com.google.firebase:firebase-core:16.0.6 to version 16.0.7. Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-measurement-connector-impl/17.0.5/firebase-measurement-connector-impl-17.0.5-javadoc.jar'. It compiles anyway. Anybody knows how to solve this? Here the stack: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-measurement-connector-impl/17.0.5/firebase-measurement-connector-impl-17.0.5-javadoc.jar'. at org.gradle

How to get the build variant at runtime in Android Studio?

倖福魔咒の 提交于 2019-11-28 06:09:01
I'd like to get the build variant during runtime, is this possible without any extra config or code? Look at the generated BuildConfig class. public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLCATION_ID = "com.example.app"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = ""; } Another option would be to create a separate build config variable for each build variant and use it in your code like

Android Studio gradle doesn't compile the specified version

三世轮回 提交于 2019-11-28 05:53:34
I've been developing this small project for some days now but suddenly today, Android Studio started to give me this error Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 14 declared in library com.android.support:support-v4:21.0.0-rc1 I understood that it is because it's trying to compile the library of Android-L. The version I want it to compile is the old version but it won't. It keeps giving me the above error no matter which version I enter. Here is the dependencies. dependencies { compile

Android Test Module (Gradle Plugin 1.3) doesn't work: “debug-classes not found”

半腔热情 提交于 2019-11-28 05:52:18
I'm attempting to set up a unit test module as described in the android studio blog post. However, doing a gradle build fails telling me "Configuration with name 'debug-classes' not found". Debug is the name of the targetVariant it's trying to build, but I don't understand what is going wrong here. Here's my test module's gradle file. apply plugin: 'com.android.test' android { compileSdkVersion 22 buildToolsVersion "22.0.1" targetProjectPath ':app' targetVariant 'debug' } This is the blogpost describing the new test module functionality. http://android-developers.blogspot.com/2015/07/get-your

Gradle: Error: more than one library with package name 'com.google.android.gms'

我的未来我决定 提交于 2019-11-28 05:18:05
What does this error message mean? I don't have duplicated packages in my project Error:Execution failed for task ':SimpleReader:processDebugResources'. Error: more than one library with package name 'com.google.android.gms' You can temporarily disable this error with android.enforceUniquePackageName=false However, this is temporary and will be enforced in 1.0 My build.gradle looks like this: buildscript { repositories { maven { url 'http://repo1.maven.org/maven2' } mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.1' } } apply plugin: 'android' android {

resValue gradle error: Unsupported type “String” in “generated.xml”

青春壹個敷衍的年華 提交于 2019-11-28 05:17:09
A few weeks ago I posted a question How to override resources depending on buildType . And just yesterday there was a gradle plugin release for android . Based on this post on G+ I decided to write this question. The problem I have described in detail: I want to create some resource values depending on the buildType , but this doesn't work properly: The file "generated.xml" will be only created if I make a complete build over the command line: gradlew build But I also get an error by building the complete project over comannd line: * What went wrong: Execution failed for task ':app:merge