android-gradle

How to solve Firebase API initialization failure (Android + Firebase)

拜拜、爱过 提交于 2019-11-28 08:05:40
I recently needed to use Google GCM in my project. From its website it is said: Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future. In order to setup a new Firebase application, I've followed the instructions provided at the official website and did the following: Created a new Firebase app in the web

How to add Android Support Repository to Android Studio?

淺唱寂寞╮ 提交于 2019-11-28 07:58:19
I'm using Android Studio with an external Android SDK. I have installed the support library and the support repository. The support repository is in: ~/Development/Tools/android/sdk/extras/android/m2repository When I add a dependency to the support library in the build.gradle file, like: ... repositories { mavenCentral() } ... dependencies { compile "com.android.support:support-v4:18.0.+" } Android Studio cannot find the support libraries (cannot resolve symbol etc) and Gradle also cannot find the libraries: Gradle: A problem occurred configuring project ':TestAndroidStudio'. > Failed to

data binding - safeUnbox warning

旧城冷巷雨未停 提交于 2019-11-28 07:56:44
after i upgrade AS gradle version to 2.3.0, data binding encounter a warning : Warning:selectMap[index] is a boxed field but needs to be un-boxed to execute selectMap[index] ? @android:color/white : @android:color/transparent. This may cause NPE so Data Binding will safely unbox it. You can change the expression and explicitly wrap selectMap[index] with safeUnbox() to prevent the warning selectMap is an ObservableMap, then i search this warning but got just few discussions and did not fix it Android Studio 2.3.0-alpha1: Databinding + int unboxing causes compile errors Databinding - data object

Error:Gradle: Execution failed for task ':app:crashlyticsCleanupResourcesDebug'. > Crashlytics Developer Tools error

本小妞迷上赌 提交于 2019-11-28 07:55:51
I have this mainActivity public class MainActivity extends RoboFragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Crashlytics.start(this); //setContentView(R.layout.activity_main); Intent intent = new Intent(this, MainActivity_with_Fragment.class); startActivity(intent); finish(); } } this is my gradle.build buildscript { repositories { jcenter() maven { url 'http://download.crashlytics.com/maven' } } dependencies { classpath 'com.android.tools.build:gradle:0.14.2' classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'

Android Studio 3.0: buildToolsVersion not found in gradle files

笑着哭i 提交于 2019-11-28 07:16:17
I recently installed new stable version of Android Studio (v3.0). Then created a new project and there was not any problem. But saw there is no buildToolsVersion field in the app-level build.gradle file. Even I searched all project files ( Ctrl Shift F ), but didn't find anything! What does this mean? And how can I determine what is the version of Build Tools in my app module? build.gradle (Project): // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools

Why there are multiple copies for the same version of gradle

给你一囗甜甜゛ 提交于 2019-11-28 07:05:52
I have an android studio project, with the file gradle/wrapper/gradle-wrapper.properties configured as following. #Wed Apr 10 15:27:10 PDT 2013 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip And I have the 2.2.1-all version installed in my home directory. .gradle/wrapper/dists/gradle-2.2.1-all/c64ydeuardnfqctvr1gm30w53/gradle-2.2.1-all.zip When I invoke ./gradlew command to build the project. I should use the gradle-2.2.1-all.zip to build.

Exclude assets for release build type

不想你离开。 提交于 2019-11-28 06:56:27
I'm importing an android library in an application built with gradle, like that: dependencies { compile 'com.example:great-lib:0.1-SNAPSHOT' } This library contains only assets, js, css and images to be used in a webview, with a layout like that: assets/ |-> great.css |-> great.min.js |-> great.min.js.map |-> js/ | |-> plop.js | |-> foo.js | ... |-> img/ | ... The js folder contains source files (to be used with source maps). I would like to include it and the .map file for the debug builds, and have only the minified js in release builds, but I can't find a way to do that. So far I've tried :

Android Gradle build : renaming the apk

倾然丶 夕夏残阳落幕 提交于 2019-11-28 06:53:26
How can I adapt my build.gradle to change the final basename of the apk(s) ? (without changing the default suffixes) Jonik On Gradle 1.8, project.archivesBaseName does work, but it gives this complaint: Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties. Deprecated dynamic property: "archivesBaseName" on "root project 'myapp'", value: "AnotherName". To get rid of the

Gradle 4.0 Unable to find a matching configuration

别等时光非礼了梦想. 提交于 2019-11-28 06:43:14
I am trying to open my existing project in new Android Studio 3.0 canary 2. I updated Gradle according to instructions , changed names for dependency configurations but I continue to get next error: Unable to resolve dependency for ':app@productionRelease/compileClasspath': Could not resolve project : abChat. And in another window: Error:Could not resolve all dependencies for configuration ':bankOK:betaNewApiInnerTestRuntimeClasspath'. > Unable to find a matching configuration in project :abChat: - Configuration 'debugApiElements': - Required apiLvl 'ProductFlavorAttr{name=newApi}' but no

What's the difference between “minifyEnabled” and “useProguard” in the Android Plugin for Gradle?

旧巷老猫 提交于 2019-11-28 06:42:36
I see that the Android Plugin for Gradle has a minifyEnabled property as well as a useProguard property, as follows: android { buildTypes { debug { minifyEnabled true useProguard false } release { minifyEnabled true useProguard true } } } What's the difference between these two properties? Or, rather, what's the meaning of each? Quoting from tools.android.com : Built-in shrinker Version 2.0 of Android Plugin for Gradle ships with an experimental built-in code shrinker, which can be used instead of ProGuard. The built-in shrinker supports fast incremental runs and is meant to speed up iteration