I'm facing issues when using one of the new Firebase features which came out a few days ago. My application has used Firebase before, but now I want to add the storage feature. Therefore I added the dependency to my gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.firebase:geofire:1.1.0+'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.firebase:firebase-storage:9.0.0' }
Below I added:
apply plugin: 'com.google.gms.google-services'
As I haven't used the plugin for google-services before, I am missing the google-servies.json file. As noted here https://developers.google.com/android/guides/google-services-plugin#troubleshooting I am supposed to get this file from google by specifying the services the app uses. However, I only use the Places API, while I can only specify "Sign-In", "Cloud Messaging", "Analytics", "App Invites" and "Ad Mob" here: https://developers.google.com/mobile/add
if you go to this link "https://console.firebase.google.com/project/yourprojectname/overview" when already logged in, you will see a button saying "Add Firebase to your Android app". Click on it and a popup will show up. On step 2 it will give you a download link for the google-servies.json file. Follow the steps and you're done.
mikewee's answer didn't work for me, since I had already gone through the migration to firebase process.
Instead, the instructions here will get you a google-services.json: https://support.google.com/firebase/answer/7015592?hl=en
To download a google-service.json for an Android app:
Sign in to Firebase and open your project.
Click and select Project settings.
In the Your apps card, select the package name of the app you need a config file for from the list.
Click google-services.json.
and then paste the google-services.json file to your project’s app folder
Related
Why Firebase dynamic link could not be made , i just don't get the reason behind dynamic link not being detected .It says that what i will need to do is put the library 11.0.4 of firebase invites in gradle. But that is also not working since my android studio fails to recognize the following library. So i don't get the reason behind the bull-bulkshit done by Google Firebase.
DynamicLink dynamicLink = FirebaseDynamicLinks.getInstance().createDynamicLink()
.setLink(Uri.parse("https://example.com/"))
.setDynamicLinkDomain("abc123.app.goo.gl")
// Open links with this app on Android
.setAndroidParameters(new DynamicLink.AndroidParameters.Builder().build())
// Open links with com.example.ios on iOS
.setIosParameters(new DynamicLink.IosParameters.Builder("com.example.ios").build())
.buildDynamicLink();
This is my gradle dependencies
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:appcompat-v7:25.3.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-invites:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
If anyone could help with that? Then please help with the fact that How to use Firebase Invite Api Sending intent with the other applications instead of being bounded by only Email and sms service?
Well, i solved my issue by doing some updating and though in the so called automated world we are surrounded in, there are few things which we need to do them manually.
So go in the settings and reach to the sdk tools option by searching in the settings dialog box.
After going there
STEP 2: Select the SDK tools and see there the google repository
option
STEP 3: If it is not installed then please install it and if studio
is showing you the update then too update it to lateset version
STEP 4:
Taadaaa...And now you are done
Now you can use firebase-invites-11.0.4 and thus you can use DynamicLinks class
I am developing my first app in android and I need some custom controls. So I want to know if I can use any github project in my app directly? If so then do I have have add any copyright or license information in my app anywhere? Also I want to know how I can use this below project in my app?
https://github.com/hdodenhof/CircleImageView
https://github.com/mutualmobile/CardStackUI
Note: The app which i am developing will be released as a commercial app
Thanks in advance,
IamHuM
CircleImageView readme, and CardStackUI readme both mention the right Gradle dependencies:
dependencies {
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.mutualmobile.android:cardstack:0.5.2'
}
That fits the Android basic project setup:
The most simple Android project has the following build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.1.0"
}
Add your own dependencies to your project.
If you looked at the README file carefully, you will find this:
dependencies {
...
compile 'de.hdodenhof:circleimageview:2.1.0'
}
That basically tells you how to install the library.
Go to your build.gradle file (Note that there are two of them, go to the one that says "Module: app"). Scroll to the very bottom and you'll see something like this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.+'
}
Yours might be slightly different, but you get the idea :)
Now add the line you found in the README to here, so it becomes:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.+'
compile 'de.hdodenhof:circleimageview:2.1.0' // this line!
}
Now do a gradle sync by pressing on the top!
Just do the same thing with the other library!
You have the IDE answers above :) Regarding licences - any commercial app complies with licences, you must understand the licences of the projects you use, and give the appropriate credit accordingly, github projects are usually Apache 2, which in a nutshell means that you can use it freely, but must:
include a copy of the licence (Apache 2)
formally mention the usage of any third-party library you are using by name and by the licence it complies to.
Other licences have other meanings and some might even be unwanted - there are some licences that you would ABSOLUTELY NOT want to use on a client app, but can be used on server side mechanisms.
Read about BSD, GPL, LGPL, and when in doubt - seek legal help (make sure they specialize in exactly that - licencing).
The place to do it could be inside the setting.
(e.g. have a look at the facebook app, inside app settings->terms & policies->More Resources->Third Party Notices), or, depending on the nature of your app - even outside, if you need the user to agree to terms of service or anything else.
In a lot of apps this would usually mean a webview directing to a webpage with all the info, since it's a lot to put in your app and would bloat it.
Check under LICENCE.txt or in the README.txt that are published with the projects.
For more info, refer to The StackExchange OpenSource resources.
Remember - you are liable, and yes - that means someone can sue if you do not handle this properly.
"open source is free speech, not free beer" :)
good luck!
This question already has answers here:
Google Play: We found Ad SDKs in your application
(5 answers)
Closed 7 years ago.
I've got an Android application that is being submitted to the Play Store. That application is built using the same Gradle build script but has several different product flavors being built which just set properties for different application ID's and names for each different flavor.
The problem we have is that AdMob is 'not' included in the build script, but some of the build flavors that are being submitted the Play Store is reporting that AdMob was found in the application. But other flavors (built from same build script) are accepted fine without any AdMob notification.
Has anyone seen this issue and possibly know what might be triggering it? Besides our own internal libraries, this is what's being included in the dependencies of the build script:
dependencies {
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
compile group: 'com.android.support', name: 'support-v4', version: '21.0.3'
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'com.google.android.gms:play-services:6.5.87'
// ViewPagerIndicator Library
compile 'com.viewpagerindicator:library:2.4.1#aar'
compile fileTree(dir: 'libs', include: '*.jar')
}
I've checked the 'libs' directory but we only have 3 jar files in it that have just some included class files so there isn't any SDK's in that directory.
This is what the Play Store is reporting:
In your gradle build script you have:
compile 'com.google.android.gms:play-services:6.5.87'
This means that all Google play services are included into your project (including AdMob as well).
Instead, you should include only play services that you need. For example:
compile 'com.google.android.gms:play-services-fitness:8.3.0'
compile 'com.google.android.gms:play-services-wearable:8.3.0'
Take a look at this guidelines.
You are using Google Play Services which includes Admob.
You can exclude Admob by only referencing the Google Play Services libraries you actually require instead of the complete set.
More details here on how to do that:
More Permissions in uploaded apk than in manifest file
I have an android application that I have to run on my laptop (I didn't develop it). The thing is, first I had an error that said Plugin with id 'com.android.application' not found so I fixed adding this to the build.gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
that works, then I go to compile the project and I have an error like this:
Project with path ':AppData:Local:Android:sdk:extras:google:google_play_services:libproject:google-play-services_lib' could not be found in root project 'Aplicacion'.
in the file build.gradle I have this:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile project(':AppData:Local:Android:sdk:extras:google:google_play_services:libproject:google-play-services_lib')
}
it seems like I have to add a library to the project path,but I don't know which one and neither where is it. So, what things should I see to fix it? thanks
It looks like you're attempting to add Google Play Services as a dependency to your Gradle-based Android app. I'd like to suggest to just follow the instructions provided by Google:
If you want to add the full Play Services library as dependency, then add:
compile 'com.google.android.gms:play-services:8.3.0'
Alternatively, you can also selectively add the submodules/APIs relevant to your app. I.e. if all you need is Google Maps, the that would be:
compile 'com.google.android.gms:play-services-maps:8.3.0'
A full list of all individual submodules/APIs can be found on that same instructions page.
To add Google Play services to an app see the following documentation here
I'm trying out Android Studio. I want to use Drive API in my project. In eclipse, there is a Google Plugin for Eclipse, but how about Android Studio? Does anyone tried it so far?
Bellow you can find last versions for Google Drive (2014.12.28):
//Google Drive API
compile 'com.google.android.gms:play-services:6.5.+'
compile 'com.google.api-client:google-api-client-xml:1.18.0-rc'
compile 'com.google.http-client:google-http-client-gson:1.18.0-rc'
compile 'com.google.api-client:google-api-client-android:1.18.0-rc'
compile 'com.google.apis:google-api-services-drive:v2-rev155-1.19.0'
To check last version try following links:
https://developer.android.com/google/play-services/setup.html
https://code.google.com/p/google-api-java-client
https://developers.google.com/api-client-library/java/apis/drive/v2
http://mvnrepository.com/artifact/com.google.apis/google-api-services-drive
I was in the same situation and had to find here an there information on how Gradle works to find the right set of dependencies and exclude needed.
Here the lines needed in the dependencies of your build.gradle file
// Replace 'dependencies' in your build.gradle file with the following
// or add these to whatever other dependencies you have.
dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.google.android.gms:play-services:4.0.30'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev105-1.17.0-rc'
}
As they keep changing in time, I've made a gist that I'll keep updated as things changes.
I've wrote an article to modify the Google Drive Quick Start to make it work with Android Studio; if interested you can find it here
EDIT: This Gradle Imports are to use the Google Drive API for Java, not the Developer Preview Google Drive API integrated with the Google Play Services.
The Java client library supports Android, as well. You can download it here: https://code.google.com/p/google-api-java-client/wiki/APIs#Drive_API
Then, unzip the Drive SDK download and move the folder into the libs section of your Project. For example:
/Users/-username-/AndroidStudioProjects/MyProject/MyProjectActivity/libs/
At this point, you can add the library to your project by clicking File -> Project Structure, and then clicking the Libraries tab, and the + sign to add the SDK into your project.
You can read the Android-specific development instructions for the Google API Client Library for Java here: https://code.google.com/p/google-api-java-client/wiki/Android
Did you try
Go to Project Structure > Global Libraries / Libraries > Link to the jar of the API you need in the SDK folder
Link the library with your module
I haven't tried google driver, but I tried google usb accessory api. In my case
Open MyProject/MyProject/build.gradle
add
compile files("libs/usb.jar")
to the dependencies block
Of course, copy the google driver libs from
android-studio\sdk\add-ons\addon-google_apis-google-10\libs\usb.jar
to MyProject/MyProject/libs
Good luck to you.
smokybob's answer worked but then I did some experiments and this also worked for me.
dependencies {
compile files ('libs/libGoogleAnalyticsServices.jar')
compile ('joda-time:joda-time:2.3')
compile ('com.google.code.gson:gson:2.2.4')
compile 'com.google.android.gms:play-services:4.1.+'
}
I am guessing the joda-time and Gson have nothing to do with the drive API.
Note when I do a
gradle dependancies
I get
+--- joda-time:joda-time:2.3
+--- com.google.code.gson:gson:2.2.4
\--- com.google.android.gms:play-services:4.1.+ -> 4.1.32
\--- com.android.support:support-v4:19.0.1
From the Extra's under the SDK manager, I downloaded Google Play Services, Google Repository and Android Support Library. Thereafter, I included dependency as below, sync'd with Gradle and was able to access the APIs.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Pls. install or update the Google Repository through the SDK manager to use this dependency.
compile 'com.google.android.gms:play-services:5.0.+'
}