build.gradle

firebase setup on android

╄→гoц情女王★ 提交于 2019-11-29 10:20:13
I can't setup the updated version of firebase on android studio. I've created json file of the project on the site firebase and copied it into the project and after coping lines in gradle: buildscript { // ... dependencies { // ... classpath 'com.google.gms:google-services:3.0.0' } } apply plugin: 'com.android.application' android { // ... } dependencies { compile 'com.google.firebase:firebase-core:9.0.1' } // ADD THIS AT THE BOTTOM apply plugin: 'com.google.gms.google-services' I get the following error: failed to resolve: compile 'com.google.firebase:firebase-core:9.0.0' How can I fix it?

android studio 3.0 Canary 1 : project refresh failed

戏子无情 提交于 2019-11-29 10:14:45
I tried to load my project in this new Android Studio 3.0 Canary 1 . It was running perfectly in my previous Android Studio Version 2.4 preview 7 This is the error I am facing: Error:Could not resolve all dependencies for configuration ':sample:devCompileClasspath'. Project :sample declares a dependency from configuration 'devCompile' to configuration 'dev' which is not declared in the descriptor for project :library. My gradle configs are as below: Project Level Build Gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha1'

How to specify source and target compatibility in Java module?

霸气de小男生 提交于 2019-11-29 10:05:36
I have a Gradle project consisting of an Android module (the com.android.library plugin is applied in the build.gradle file) and a Java module (the java plugin is applied in the build.gradle file). Within the build.gradle file of the Java module I was previously specifying the source and target compatibility as follows: apply plugin: 'java' compileJava { sourceCompatibility = 1.7 targetCompatibility = 1.7 } I've just updated the project's "Android Plugin for Gradle" and "Gradle Wrapper" versions to the latest releases (2.2.3 and 3.2.1 respectively) and I'm now seeing warnings in the Java

NoClassDefFoundError using Jackson 2.2.x on Android with Gradle

萝らか妹 提交于 2019-11-29 10:02:24
For my Android project I set up Gradle with Jackson 2.2.x as follows: // build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 18 buildToolsVersion "18.1.0" defaultConfig { minSdkVersion 8 targetSdkVersion 18 } } dependencies { compile 'com.android.support:appcompat-v7:18.0.0' compile 'com.android.support:support-v4:18.0.0' compile 'com.google.android.gms:play-services:3.1.36' compile 'com.fasterxml.jackson.core:jackson-databind:2.2.+'

Error:Execution failed for task ':app:mergeDebugResources'. > Some file crunching failed, see logs for details build gradle issues

大憨熊 提交于 2019-11-29 09:20:28
currently I am using Android Studio 2.1 when I run my App it shows me some error in Message Gradle Build saying the following Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:generateDebugAndroidTestSources, :app:assembleDebug] :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72221Library :app:prepareComAndroidSupportDesign2221Library :app:prepareComAndroidSupportSupportV42221Library :app

Android Studio export jar with dependencies

混江龙づ霸主 提交于 2019-11-29 09:08:54
问题 I had a project library in Eclipse with Maven and the generated jar included some libraries dependencies inside. Now I am migrating to Android Studio and I would like to build the same jar. I can generate a jar with the following lines in gradle: task clearJar(type: Delete) { delete 'build/libs/mysdk.jar' } task makeJar(type: Copy) { from('build/intermediates/bundles/release/') into('release/') include('classes.jar') rename ('classes.jar', 'mysdk.jar') } makeJar.dependsOn(clearJar, build) But

Gradle + Buildship - Switch dependency between JAR and projects

允我心安 提交于 2019-11-29 08:57:29
问题 I'm having some trouble configuring Buildship for Eclipse the way I want. I currently have > 50 projects always open in Eclipse, but I want to move to having only the projects I am actively working on in Eclipse, and the other projects would use a Maven repository to resolve their dependency. Lets say ProjectA (which contains a main) depends on ProjectB (a library project). If ProjectB is opened in Eclipse, I would like ProjectA to use ProjectB directly. A change in the code in ProjectB would

How to set my gradle for final release apk

白昼怎懂夜的黑 提交于 2019-11-29 08:19:09
问题 Earlier my gradle was like this: WHICH IS OFCOURSE INCORRECT apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion '19.0.3' defaultConfig { minSdkVersion 11 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:gridlayout-v7:19.0.1' compile 'com.android.support:appcompat-v7:+' compile fileTree(dir:

Use different VersionCode for Debug/Release android gradle build

被刻印的时光 ゝ 提交于 2019-11-29 08:02:20
问题 I'd like to apply different VersionCode to make apk file. For debug only fix it to 1 , and for release whatever number specified in defaultConfig. Below code gives mypackage-release-1.apk file as assembleRelease artifact, which is not expected. I expected mypackage-release-10111.apk for that. why the line debug { defaultConfig.versionCode=1 } affects assembleRelease artifact? defaultConfig { versionCode 10111 versionName '2.5.4' minSdkVersion 10 targetSdkVersion 21 } signingConfigs { debug {

Execution failed for task 'app:prepareDebugAndroidTestDependencies'

寵の児 提交于 2019-11-29 07:58:10
I'm trying to build UI tests for my Android application in Android Studio. The problem is that I can't run them. I get the message: Execution failed for task 'app:prepareDebugAndroidTestDependencies' which I couldn't find what it's about. When I run my application, it starts perfectly, but when i try to run tests it shows the mentioned message. My build.gradle is lsited below: apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.0" defaultConfig { applicationId "ba.etf.pkks.eldaralmin.libraryapp" minSdkVersion 15 targetSdkVersion 22 versionCode 1