Firebase Dynamic Link Classes not getting recognized in androidstudio - android

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

Related

Integrating github projects in my app using Android Studio

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!

AdMob without Firebase, not resolving

We were using AdMob with out Firebase, we don't need Firebase integration and we are just trying to ad below in dependencies:
dependencies {
compile 'com.google.firebase:firebase-ads:9.4.0'
}
It's not resolving the AdMob variables, we are stuck here. We tried all clean, make project steps. Someone faced this issue?
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:xx.x.x'
compile 'com.google.firebase:firebase-ads:9.6.0'
}
...
apply plugin: 'com.google.gms.google-services'
Have you tried apply plugin: 'com.google.gms.google-services'after dependencies.
If not., add and sync once. Hope this will help.
for more details. read this document.
https://firebase.google.com/docs/admob/android/quick-start
If you're not using Firebase, it's best to avoid using any of the Firebase gradle dependencies. Instead, use this one to import the Google Mobile Ads SDK by itself:
dependencies {
compile 'com.google.android.gms:play-services-ads:9.6.0'
}
You'll need to make sure the Google Repository has been downloaded by your SDK manager. If it's not, don't worry -- Android Studio will prompt you.
If you're interested, we wrote a blog post about the different ways of importing the SDK, and what your app will get with each one.
Hope that helps!

File google-services.json is missing, but what services?

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

Getting Latest Library Dependency - Android

I'm new to Gradle and I need to make sure that my Android project has the latest dependencies with regards to RxAndroid and RxJava. Forgive me for my ignorance but could someone explain how I go about to make sure that the libraries I include in my project are the latest ones? Where does Gradle downloads these libraries from? Is there a central repository? Is GitHub the source? It's not clear from the code shown below:
build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
}
I would really appreciate if someone could shed some light with regards to this topic.
Gradle downloads them from Maven or other repos. I don't believe GitHub hosts the libraries themselves, but the link to download the libraries could be found on GitHub.
To ensure they are the latest version, you will have to go the library's web page(Git hub page usually) and check if a latest version has been released.
If I am not wrong, you could add a + sign at the end and when you sync Gradle with work in offline mode turned off, it should fetch the latest version of the library.
Eg:
compile 'com.android.support:appcompat-v7:23.3.0+'
compile 'io.reactivex:rxandroid:1.0.1+'
The above line will ensure that 1.0.1 is the min version that you will download and if there are any higher version, it will download that instead.
WARNING : this is not a safe thing to do, because the latest version of library will be automatically downloaded and the changes in the newer version of the library might have breaking changes, and break your app. For instance the methods you use from a library might be removed in the new library or even worse things could happen and it has to me. I suggest you set some time apart once every few weeks and see if there are new updates and consider if it is safe to update.
Deciding to add a library to your project must be carefully thought through, as you are making the project dependent on it and if that library dies out or is buggy, your project too will be screwed. Incase you didn't, I suggest you read this on how being careless with adding dependencies literally broke the internet.
You can just add a plus to the end of each, although it's not recommended as sometimes new libs will break your code.
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0+'
compile 'io.reactivex:rxandroid:1.0.1+'
compile 'io.reactivex:rxjava:1.0.14+'
}
Here are the latest:
dependencies {
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'io.reactivex:rxandroid:1.2.0' // Upgraded
compile 'io.reactivex:rxjava:1.1.5' // Upgraded
testCompile 'junit:junit:4.12'
}
check here

Keep using the old Google Drive API on Android

I have an existing app which I have unfortunately haven't had time to update it in quite a long time. I am now trying to do some work on it but it won't compile.
It was originally an Eclipse project so I've now imported it into Android Studio, my build.gradle has the following:
dependencies {
/*compile 'com.google.android.gms:play-services-ads:7.0.0'
compile 'com.google.android.gms:play-services-drive:7.0.0'
compile 'com.google.android.gms:play-services-identity:7.0.0'*/
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/android-support-v4.jar')
compile files('libs/commons-codec-1.4-javadoc.jar')
compile files('libs/commons-codec-1.4-sources.jar')
compile files('libs/commons-codec-1.4.jar')
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.BoardiesITSolutions:CritiMon:1.0'
compile 'com.BoardiesITSolutions:Library:1.1'
compile 'com.google.android.gms:play-services:4.1.+'
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+'
}
I am trying to point it at the old versions of Google Play Services, the bit of code below which was originally working but now it no longer is.
Drive service = getDriveService(credential);
String fileId = null;
FileList file = service.files().list().execute();
The problem is services.files() cannot be resolved.
I am assuming this is because of the Drive API being updated so is there a way that I can use the previous version that supports the above code.
At the moment I don't have time to update the Drive API but I need to fix a bug that someone's reported.
Update
I've found the following https://developers.google.com/drive/web/migration page which says that there aren't any real changes apart from a variable name for the file id but everything is the same so I don't understand why the service.files() function wouldn't be found.
To consolidate the comments (esp #kroikie) into an answer, you have confused the Java library for the REST API (which can run on Java/Android and is represented by com.google.api.services.drive.Drive) with the Google Drive API for Android ("GDAA" - which simply reads and writes to the Drive storage area on Android and lets the Android Drive app do the syncing, and is represented by com.google.android.gms.drive.Drive).
This guy The method permissions() is undefined for the type Drive has done the same thing, which suggests that the Google documentation is failing to make it clear that there are two different ways that Android-Drive integration can be achieved. I've seen people refer to the REST API as the "old api", which is a complete misnomer and suggests that some people have drawn the false conclusion that GDAA replaces the REST API which it most certainly doesn't.
So in your case, expunge com.google.android.gms.* from your app and you'll be fine.

Categories

Resources