Remove firebase analytics from android app completely - android

I added firebase analytics in my app just to try it out. I followed the steps in official guidelines.
Now I have decided against it. I have undone whatever I had done to add it.
(Removed entries from project level and app level build.gradle; removed all usages from source code.)
But I am still getting logs like this when my app runs:
I/FirebaseInitProvider: FirebaseApp initialization successful
This leads me to believe that I haven't removed it completely. This is really a matter of concern for me now because my app has exceeded method count limit and I have had to enable multidex.
How can I completely remove firebase from my app?

If you want to completely remove the firebase, you can achieve it by reversing the setup steps.
Remove classpath 'com.google.gms:google-services:3.0.0' from your project gradle.
Remove compile 'com.google.firebase:firebase-core:9.2.0' from your app build.gradle.
Remove apply plugin: 'com.google.gms.google-services' from the bottom of your build.gradle.
Remove FirebaseService code from your project.
Remove google-services.json from your project.
Remove google key from your Manifest.
Remove google key from your resource value.
Clean project.
Build project.
Remove installed app from test device, then install it again.
-- UPDATE --
From https://stackoverflow.com/a/37945280/4758255 :
I would suggest you to exclude the firebase group using gradle in app module build.gradle, you can add this in dependency:
compile('com.google.android.gms:play-services-ads:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
compile('com.google.android.gms:play-services-gcm:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
Or, simply apply a global exclude configuration (Remember that this should be outside any groovy function), like this :
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}

Adding
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-core'
all*.exclude group: 'com.google.firebase', module: 'firebase-iid'
}
removes all lines from app/app.iml containing firebase (and they do not get added automatically again) and removes all firebase libraries from generated code and intermediate output as well.
Compared to the previous answer this knocks off another 87,000 bytes from apk size.
Though I still do not understand why I should have to ADD more code to undo adding something. It's probably a bug in the build system.
#isnotmenow: Thanks a lot for pointing me in this direction.

I had the same issue, i removed google_services.json file. Removed firebase dependencies and most importantly in build.gradle (Project: GrowBuds) remove the following line
apply plugin: 'com.google.gms.google-services'

i was also facing this issue and after too much effort i have find a legal solution
1)Change the package name
the method of changing the pacakage name
1) convert your studio from project level to android level
2)right click on android level and click on Compact middle pacakage
3)change the middle name of packge
4)again like 3rd step change the last name of package
5)change the package name in gradle file
2)go to firebasel console add project manullay
add your new pacakge name
add your sha1 key and continue
3)synchronise your project yahoo you have done \
List item

Related

How to remove 'io.card' from Cordova/payPal SDK

I am building Android app with cordova on windows PC and I have been trying to remove 'io.card' from my payPal cordova sdk in order to reduce the size of my apk; but to no avail.
I have read their manual about Disabling Direct Credit Card Payments by including
`dependencies {
compile('com.paypal.sdk:paypal-android-sdk:2.15.1') {
exclude group: 'io.card'
}
}`
in "MY" build.gradle file. They did not show the location of the build.gradle file that should be modified. However I managed to find a build.gradle file under "PROJECT_FOLDER/platforms/android/" However, when I add the
compile('com.paypal.sdk:paypal-android-sdk:2.15.1') {
exclude group: 'io.card'
}
But when I do a new build (cordova run) the dependencies gets removed and therefore the size of my application remains 33.6MB instead of 17.6MB.
I have also seen This Post But the answer is not clear to me.
I will be glad if someone can show me what I am doing wrong, or not doing right. Thank you
This is the link to my build.gradle file -> build.gradle

App initialization very slow: FirebaseApp initialization unsuccessful

I know about this question but I don't think it helps me and the problem looks slightly different.
I'm doing this app where I need to implement AppsFlyer for tracking and I'm required to use only 2 components from Google Play Services:
com.google.android.gms:play-services-ads
com.google.android.gms:play-services-gcm
And I'm using the latest version of the Google Play Services, 9.0.2 that is.
The problem is that on the first app launch after installing the app, the app takes quite a bit of time to start. There's no log output and when the app starts doing something, the first line on the log is:
06-16 16:50:23.782 22368-22368/com.company.app I/FirebaseInitProvider:
FirebaseApp initialization unsuccessful
I'm not using Firebase, how can I get rid of this? It really slows down the application initialization. Not a very good user experience...
EDIT:
I've added both libs, one at a time and I've realized that the GCM is the one causing the issue. When I add:
com.google.android.gms:play-services-gcm
I start getting the "FirebaseApp initialization unsuccessful" log and the app takes a while to start. Perhaps downgrading "fixes" the problem, but that's not a very good solution.
I would suggest you to exclude the firebase group using gradle:
compile('com.google.android.gms:play-services-ads:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
compile('com.google.android.gms:play-services-gcm:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
Or, simply apply a global exclude configuration, like this:
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}
Hope it helps :)
I had the same issue and not only I had to downgrade the services but also gradle version.
In my case I had (in app/build.gradle)
compile 'com.google.android.gms:play-services-location:9.0.2'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.google.android.gms:play-services-gcm:9.0.2'
and (in build.gradle)
classpath 'com.android.tools.build:gradle:2.1.2'
After changing services back to 8.4.0 and gradle to 1.5.0 (Probably higher version is fine also but it was the one I had before upgrading to 2.1.2) everything is fine and FirebaseApp initialization is gone.
Maybe it's not the best solution but I couldn't find anything else.

How can I find the dependencies in my app that are using findbugs? (findbugs conflict)

I'm trying to discover the specific conflict when adding espresso to my app's gradle file:
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1') {
exclude group: 'com.android.support', module: 'support-annotations'
}
Android Studio states "Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'.
Dependency conflict error in my Android app which has Android Tests states the error means the dependency I am using in my app is version 3.0.0 while the one in my test app is 2.0.1.
However, my gradle never explicitly adds "com.google.code.findbugs", indicating it was part of another dependency I added to my "compile" and "androidTestCompile" statements. How do I find the dependencies in my app that are using findbugs?
Check your dependencies:
HelloApp/
app/
- build.gradle // local gradle config (for app only)
...
- build.gradle // global gradle config (for whole project)
- settings.gradle
- gradle.properties
Check here:
dependencies {
compile project(':libraries:lib')
}
Later check this LINK you have Unit testing support orientation
Execute the following command:
./gradlew app:dependencies
This will print a (large) graph of dependencies.
For the meaning of the arrows and stars, please refer to this SO answer.

Gradle dependencies for Android app which uses google cloud endpoint client libs

While following along with the demo in this video :
https://www.youtube.com/watch?v=7Sp4Lr3Qmcw
I noticed that at 16:56 in the video :
http://youtu.be/7Sp4Lr3Qmcw?t=16m56s
the presenter pastes the following snippet into build.gradle of the android app :
compile('com.google.todotxt.backend:taskApi:v1-1.17.0-rc-SNAPSHOT') {
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
compile('com.google.http-client:google-http-client-android:1.17.0-rc') {
exclude(group: 'com.google.android', module: 'android')
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
but does not explain how he got those lines.
The previous step of :
==> ./gradlew appengineEndpointsInstallClientLibs
also does not show what artifacts were created and what the names of the artifacts were.
So, it is not clear how the presenter obtained the names of the artifacts from the previous step.
Does anyone know how the presenter was able to figure out what the names are, of the artifacts generated from the the install-client-libraries-step are.
That video is from an older version of Android Studio. Updated instructions for integrating an appengine backend with your android application are available at : https://github.com/GoogleCloudPlatform/gradle-appengine-templates
Basically there is some cross module dependency configuration that tells your android module to pull the endpoints artifact from the appengine module. The new flow doesn't use a Maven repository anymore.
However if you still want to find out how the names are discovered. You have to go into the build directory of your appengine project, into the client libraries folder, unzip those zips and looks in the build.gradle file for the client library to see the artifact output name.

Duplicate class contained in the libs of android project

When I was trying to use Android Studio to debug my project, I got the following error,
Class com.google.ads.AdRequest.Gender has already been added to output. Please remove duplicate copies.
The cause seems to be that the google play services lib and another lib used by my project both contain the com.google.ads.AdRequest.Gender class, and I don't think I can remove it from either one.
Does anyone know how to fix this problem?
Thanks a lot.
I tried the following statement in build.gradle in order to exclude the duplicated classes in the google play services lib, but it still does not solve the problem.
compile ('com.google.android.gms:play-services:4.1.32') {
exclude group: 'com.google.ads'
}
You can try using Gradle's exclude mechanism when setting up the DatawindAdsSdk-2.0 dependency. There are docs available, but it will probably look something like this:
dependencies {
compile files('libs/datawindAdsSdk-2.0.jar') {
exclude group: 'com.google.ads'
}
}
experiment with that and see if you can get it working.
But I came to this post via google and I read this post has the same problem as me. I solved it excluding the group and the whole library. In my case the problem was with an animatorListener.
compile ('com.rengwuxian.materialedittext:library:1.8.2'){
exclude group: 'com.nineoldandroids', module: 'library'
}
This is my post duplicate library gradle animatorlistener duplicate

Categories

Resources