Two different projects with same package name - android

I developed an Android project with project name DemoMessageing, package name com.abc.xyz and added FCM to that project as created project in Firebase with package name com.abc.xyz for cloud messaging, applied SHA-1 and downloaded google-service.json. Put that .json in my app. I uploaded that project on Google Play also uploaded updates to the same.
Now i created new project in Firebase same package name com.abc.xyz but different project name as DemoMessageingTest. Removed the SHA-1 from old projectDemoMessageing) and applied same SHA-1 in new project(DemoMessageingTest) in Firebase. Download new google-service.json and place in my app.
Now i created signed apk and tried to upload on google play as a update for existing project. But google play is giving error as:
I increased the code version and again tried to upload the app on google play. But having same error.
My build.gradle is as below:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.abc.xyz"
minSdkVersion 16
targetSdkVersion 27
versionCode 8
versionName "8"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false //delete the already predexed libraries
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support.constraint:constraint-layout:1.1.0'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.whereismytransport.transportapisdk:transportapisdk:1.0.1', {
exclude group: 'org.json', module: 'json'
}
compile('com.twitter.sdk.android:twitter:3.1.1#aar') {
transitive = true
}
compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.google.firebase:firebase-messaging:10.2.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.android.support:design:27.1.1'
compile 'com.android.support:cardview-v7:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.1'
compile 'com.google.android.gms:play-services:10.2.1'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.squareup.picasso:picasso:2.4.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:multidex:1.0.1'
compile('com.crashlytics.sdk.android:crashlytics:2.7.0#aar') {
transitive = true;
}
compile project(':commonwidget')
compile project(':common')
compile project(':panowidget')
compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-7'
compile project(':emojilib')
compile files('libs/commons-lang-2.5.jar')
compile 'com.amazonaws:aws-android-sdk-core:2.2.13'
compile 'com.amazonaws:aws-android-sdk-s3:2.2.13'
compile 'com.amazonaws:aws-android-sdk-ddb:2.2.13'
}
apply plugin: 'com.google.gms.google-services'
I am not able to understand what i am missing or what i am doing is right or not.
Please guide me with you suggestion and experience.

The error message tells you exactly what the error is.
You need to use a different version code for your APK or Android App Bundle because you already have one with version code 7
Your previous APK you uploaded with version code 7. If you keep the same package name, when you are uploading a new APK, you are sending an update to users. When an update happens, the version code must increase in your app. Increase your app version code (eg to 8), rebuild your APK, and the APK should upload fine.

Related

Unable to install signed apk file in any mobile other than Nougat phones

I generated a signed apk file & trying to install on a mobile device.
But the app is not installing. Its showing app is not installed popup.
I'm able to install the apk in mobile with Nougat & the app is fully functional in debug mode.
Can anyone give me possible reason & solution for this issue.
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "prasenjit.com.pickcel"
minSdkVersion 20
targetSdkVersion 25
versionCode 5
versionName "1.5"
multiDexEnabled = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
sourceSets {
main {
assets.srcDirs = ['assets']
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
repositories {
maven { url "https://jitpack.io" }
maven { // this is for realm-db
url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile project(path: ':material-login')
compile project(':MPChartLib')
compile project(':materiallettericon')
compile 'com.github.PhilJay:MPAndroidChart-Realm:v2.0.2#aar'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.felipecsl:gifimageview:2.1.0'
compile 'com.firebaseui:firebase-ui-database:3.0.0'
compile 'commons-io:commons-io:2.4'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-firestore:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.firebase:firebase-storage:11.4`enter code here`.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Got the solution for my issue.
Its something called Environment change in mobile OS which happens when we try to install signed apk & unsigned apk multiple types.
Once installed from play store, i tried to reinstall the above signed apk & its working.
Go to your phone settings, find you app inside installed apps list and do uninstall for all users

"Unable to merge dex" error when update to Android Studio 3.0?

This error appears after I updated to Android Studio 3.0. I tried many ways in many similar questions, but nothing works.
Here is the error:
I realized that when I remove the library 'com.google.android.gms:play-services-maps:11.4.2' my project build successful. But I need this library in my project, anyone knows how to deal with this problem?
My complete build.gradle.
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "vn.com.ttsoft.dhd"
minSdkVersion 21
targetSdkVersion 25
versionCode 14
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
useLibrary 'org.apache.http.legacy'
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
}
}
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/google-play-services.jar')
compile files('libs/gson-2.3.1.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'com.github.pavlospt:roundedletterview:1.2'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'me.tatarka.support:jobscheduler:0.1.1'
compile 'com.evernote:android-job:1.1.8'
testCompile 'junit:junit:4.12'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')
}
I am putting the gradle file you can use it may help you
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "vn.com.ttsoft.dhd"
minSdkVersion 14
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
// Disable fabric build ID generation for debug builds
ext.enableCrashlytics = false
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/android-async-http-1.4.4.jar')
compile files('libs/google-play-services.jar')
compile files('libs/gson-2.3.1.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true;
}
compile 'com.github.pavlospt:roundedletterview:1.2'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'me.tatarka.support:jobscheduler:0.1.1'
compile 'com.evernote:android-job:1.1.8'
testCompile 'junit:junit:4.12'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/mail.jar')
}
apply plugin: 'io.fabric'
and another project gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
I was also facing the same issue and I think something is wrong with google play services dependencies so I got it resolved by adding all below google play services dependencies :
compile 'com.google.android.gms:play-services-base:11.4.2'
compile 'com.google.android.gms:play-services-auth:11.4.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.android.gms:play-services-gcm:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
I had a similar problem with the 'Multiple Dex' build error after upgrading to AS 3.0 / Gradle 3.0.0.
I found that the invalidate caches and restart, clean project, and minifyEnabled "solutions" were all red herrings.
I struggled with this for a few hours then found out what was causing my problem.
I was compiling Picasso, GSON and SQLiteAssetHelper using the statements
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.squareup.picasso:picasso:2.5.2'
...but I also had the sqliteassethelper, GSON and Picasso .jar files being compiled from my \libs folder.
compile fileTree(include: ['*.jar'], dir: 'libs')
Hence the duplicates.
Yes - pretty obvious but sometimes you can't see the wood for the trees!
I hope this helps someone.
(Final Note: compile command is deprecated in Gradle 3.0.0, therefore you might wish to change the above commands from compile to implementation)
What version of Play Services do you load from file? I guess that's an issue, you try to load whole play services and partial play-services-maps together. Also that explains the fact that, when you remove maps, everything works fine.
take a look on this link for selective compiling play services APIs, this will also help to reduce method count
https://developers.google.com/android/guides/setup
To somebody who is using android-async-http and had tried enable DEX, invalidate cache, delete .gradle files and check duplicate import/version:
I have some conflict in org.apache and android-async-http packages,
after I change i.e. org.apache.http.Header
to cz.msebera.android.httpclient.Header, my problem solved.
{
useLibrary 'org.apache.http.legacy' // avoid this
}
dependencies {
compile files('libs/android-async-http-1.4.4.jar') // only keep this one
}

Google Services Version conflict

I am trying to fix this google services version error. I have been using Google services version 10.2.4 before for Google Sign in. Now since I want to integrate the Geofencing API into my application, as per what I have researched, it requires at least a minimal version of 11.0.0. But, I am not able to figure out what exactly the issue is. Please find below the error I get
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is available at
https://bintray.com/android/android-tools/com.google.gms.google-
services/) or updating the version of com.google.android.gms to 10.2.4.
Please find below my app build.gradle file
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.project.group.projectga"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
resValue "string", "google_maps_key",
(project.findProperty("GOOGLE_MAPS_API_KEY") ?: "")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile('com.mikepenz:materialdrawer:5.1.6#aar') {
transitive = true
}
//Added this for Visual Gallery implementation - Start
//Added this for Visual Gallery implementation - End
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.google.firebase:firebase-auth:10.2.4'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.satsuware.lib:usefulviews:2.3.6'
compile 'com.google.firebase:firebase-database:10.2.4'
compile 'com.google.firebase:firebase-storage:10.2.4'
compile 'com.google.android.gms:play-services-auth:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services-location:11.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.mikepenz:google-material-typeface:2.2.0.1#aar'
compile 'com.mikepenz:fontawesome-typeface:4.4.0.1#aar'
compile 'com.github.medyo:fancybuttons:1.6'
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'com.github.yesidlazaro:GmailBackground:1.2.0'
compile 'com.android.support:support-annotations:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}
apply plugin: 'com.google.gms.google-services'
And also my build.gradle(Project) file.
build.gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I followed a lot of Stack Overflow answers, and they said to add the plugin of the google services at the end. I have the plugin added right from the start and it seems not to work for this. I am trying to integrate the Geofencing API which requires the Google services version to be at least 11.0.0, but I couldn't do that.
Move your firebase and com.google.android.gms modules to the same version and at least 11.0.0 :
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'

compile appcompat v7:26.+ error when adding play services for fusion location provider

I have an issue and have looked at possible duplicate questions and answers and I think this one is not answered by the others so asking it here.
I updated my play services to make use of the fused location provider and now the appcompat in my gradle is showing an error.
So I created a new project and checked the build.gradle on the new project and have exactly the same appcompat but my project is showing an error.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "au.com.itmobilesupport.sqltwo"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
}
Its this line that is showing the error:
compile 'com.android.support:appcompat-v7:26.+'
But in a new project its fine. Why am I getting the error?
UPDATE:
If I remove these two lines then the error goes away:
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.google.android.gms:play-services:11.0.1'
But I need them so still have the error.
Add these lines to your build.gradle file to get libraries that you don't have based on Google site.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Caution: Using dynamic dependencies (for example, palette-v7:23.0.+) can cause unexpected version updates and regression incompatibilities. We recommend that you explicitly specify a library version (for example, palette-v7:25.4.0).
Finally solved the issue with the help of ZeroOne's answer to a similar question.
What led me to look at ZeroOnes answer was Google giving me the reason but not as an error. My issue was that the following line is too encompassing and a lot of extra dependencies were added that would have made the app unnecessarily larger.
compile 'com.google.android.gms:play-services:11.0.1'
I simply needed to be more specific and the error disappeared.
Here is the final gradle.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "au.com.itmobilesupport.sqltwo"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-maps:11.0.1'
compile 'com.google.android.gms:play-services-location:11.0.1'
}
And this is the specifc line I change the above to:
compile 'com.google.android.gms:play-services-location:11.0.1'
Hope it helps someone who comes across the same issue.
Being more specific using compile 'com.google.android.gms:play-services-location:11.0.1' rather than compile 'com.google.android.gms:play-services:11.0.1' saved my project as well, tks a lot guys.

How to fix Error: Duplicate resources for global_tracker.xml when adding Google Analytics?

I'm trying to implement Google Analytics in my App , but when compiling I get the following error:
Error:Execution failed for task ':app:mergeDebugResources'.
[xml/global_tracker]
C:\Users\Carlos\AndroidStudioProjects\Capstone\SP\Stocks Panel
Lite\app\src\main\res\xml\global_tracker.xml [xml/global_tracker]
C:\Users\Carlos\AndroidStudioProjects\Capstone\SP\Stocks Panel
Lite\app\build\generated\res\google-services\debug\xml\global_tracker.xml:
Error: Duplicate resources
I've tried to run clean project, but I get the same error. I also get the same error if I remove app/build.
Thanks in advance.
UPDATE: build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.carlos.capstone"
minSdkVersion 11
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:gridlayout-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:support-annotations:23.1.1'
compile 'com.squareup.retrofit:retrofit:2.0.0-beta2'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta2'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta2'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.1.1'
compile 'com.squareup.okhttp:logging-interceptor:2.6.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
compile 'com.bignerdranch.android:expandablerecyclerview:2.0.4'
compile 'com.crazyhitty.chdev.ks:rss-manager:0.21'
compile 'com.github.frankiesardo:linearlistview:1.0.1#aar'
compile 'com.github.bumptech.glide:glide:3.5.2'
compile 'com.facebook.stetho:stetho-urlconnection:1.3.1'
compile 'com.facebook.stetho:stetho:1.3.1'
compile 'com.android.support:customtabs:23.0.0+'
compile 'com.squareup.leakcanary:leakcanary-android:1.3.1'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'org.apache.poi:poi:3.14'
compile 'net.sf.supercsv:super-csv:2.4.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
}
This happens when you place a global_tracker.xml in your resources xml folder and in addition to that add apply plugin: 'com.google.gms.google-services' in your build.gradle file. That is mixing the old way of implementing the tracker with the new way of doing things. The solution would be to simply remove the global_tracker.xml from your xml folder, as the google-services plugin will automatically add all the required data from the google-services.json configuration file when building your app.
Also, it's advisable to place the apply plugin: 'com.google.gms.google-services' line at the bottom of your build.gradle after the dependencies section. It's strange, but having it at the top causes errors in some configurations.
In addition, you might see error: cannot find symbol variable global_tracker when trying to build your project, especially if you are converting an older project, and downloaded your google-services.json from your Firebase console while still using it with the older Google Analytics. In that case, open the newly added google-services.json and find "analytics_service" in the "services" object. You will need to add the following:
"analytics_property": {
"tracking_id": "<your tracking id>"
so the entire section looks like this (place your own UA-XXXXXXXX-X tracking ID there):
"analytics_service": {
"status": 2,
"analytics_property": {
"tracking_id": "UA-12345678-9"
}
},
After that make sure to Clean your project and re-sync Gradle before you rebuild. Hope that helps.

Categories

Resources