I try to learn how i can use google sign in in my android App, but i catch com.google.android.gms.common.api.ApiException: 16
And i can't find on stackoveflow answer, what is it and why i catch it. In documentation i read, what it "was canceled by user", but my google account accepted to install apps
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.gms.auth.api.signin.GoogleSignInAccount
import android.content.Intent
import com.google.android.gms.tasks.Task
import com.google.android.gms.common.api.ApiException
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build()
val mGoogleSignInClient = GoogleSignIn.getClient(this, gso)
val account = GoogleSignIn.getLastSignedInAccount(this)
if(account != null){
Log.e("!!!", account.email)
} else {
val signInIntent = mGoogleSignInClient.signInIntent
startActivityForResult(signInIntent, 0)
}
}
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
if (requestCode == 0) {
// The Task returned from this call is always completed, no need to attach
// a listener.
val task = GoogleSignIn.getSignedInAccountFromIntent(data)
handleSignInResult(task)
}
}
private fun handleSignInResult(completedTask: Task<GoogleSignInAccount>) {
try {
val account = completedTask.getResult(ApiException::class.java)
// Signed in successfully, show authenticated UI.
Log.e("!!!", account.email)
} catch (e: ApiException) {
e.printStackTrace()
}
}
}
I followed this guide. Did the configuration of the project.
If it's matter, i use VDS for this. Account was created in the same place
Here is stackTrace:
com.google.android.gms.common.api.ApiException: 16:
at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source)
at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
at foryou.friendly.alisa.alisa.MainActivity.onActivityResult(MainActivity.kt:47)
at android.app.Activity.dispatchActivityResult(Activity.java:7124)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4173)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4220)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1579)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6228)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
I had the same problem, start activity result kept coming back with RESULT_CANCELED and errorCode 16. The problem was my client configuration in Google Cloud Platform Console. I was using the regular debug and release api key. The result came back OK when I used web application as my Google Console configuration.
Hope it helps.
I am developing an Android application using Flutter, tried to integrate Google Sign In and faced the same problem with ApiException: 16 and SIGN_IN_FAILED (instead of RESULT_CANCELED).
Application type on Firebase was set to android.
In my case, after many hours of debugging, it turned out to be a wrong SHA-1 problem.
As soon as I extracted the SHA-1 key from my project and updated Firebase console, it worked.
Was having the same problem, turns out I did not set support mail on firebase project settings.
If this is the case, firebase will show you edit project settings when trying to enable Google sign in on Firebase Authentication. You can copy your client Id from firebase
For me the only thing that worked was to provide 2 oauth client ids. a web application client id AND an android client id
In my android app i use the client id and client secret of the web application. Even though i don't use the android client id anywhere in my app it is still required. ie if i delete the oauth android client in the google api console my app stops working EVEN THOUGH i dont use that client id ANYWHERE in my app.
this makes absolutely no sense to me! go figure . but so far this is the only thing that has worked.
un-freaking-believable.
Maybe a bit late to the party here but after more than 4 hours debugging I realized that:
1.- Add an Android client with your signing-certificates fingerprints under the OAuth client IDs list. This is mandatory.
2.- Add the Web application client ID in your code in case your need to get an id token
// ID and basic profile are included in DEFAULT_SIGN_IN
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken("YOUR_CLIENT_ID")
.requestEmail()
.build();
Hope it helps
I used a different oauth id key which i found from downloading the project settings and added the client 3 key in the project.
Related
I am currently using Firebase-UI for Android to implement authentication flow in my app. I currently have Google, Facebook, and Email auth providers enabled. My Android app is built using Jetpack Compose and I'm using rememberLauncherForActivityResult to launch the login intent. Everything is working as expected with the normal flow.
However, when I try to use my Facebook login with the same email that I have previously authenticated using Gmail, I am getting the below error.
A sign-in error occurred.
com.google.firebase.auth.FirebaseAuthUserCollisionException: This credential is already associated with a different user account.**
at com.google.android.gms.internal.firebase-auth-api.zzxc.zzb(com.google.firebase:firebase-auth##21.1.0:4)
at com.google.android.gms.internal.firebase-auth-api.zzya.zza(com.google.firebase:firebase-auth##21.1.0:7)
at com.google.android.gms.internal.firebase-auth-api.zzyb.zzl(com.google.firebase:firebase-auth##21.1.0:1)
at com.google.android.gms.internal.firebase-auth-api.zzxy.zzq(com.google.firebase:firebase-auth##21.1.0:3)
at com.google.android.gms.internal.firebase-auth-api.zzxy.zze(com.google.firebase:firebase-auth##21.1.0:1)
at com.google.android.gms.internal.firebase-auth-api.zzxa.zze(com.google.firebase:firebase-auth##21.1.0:1)
at com.google.android.gms.internal.firebase-auth-api.zzvf.zzd(com.google.firebase:firebase-auth##21.1.0:8)
at com.google.android.gms.internal.firebase-auth-api.zzuf.zzb(com.google.firebase:firebase-auth##21.1.0:2)
at com.google.android.gms.internal.firebase-auth-api.zzyj.zzb(com.google.firebase:firebase-auth##21.1.0:12)
at com.google.android.gms.internal.firebase-auth-api.zzyj.zza(com.google.firebase:firebase-auth##21.1.0:14)
at com.google.android.gms.internal.firebase-auth-api.zzxp.zzq(com.google.firebase:firebase-auth##21.1.0:4)
at com.google.android.gms.internal.firebase-auth-api.zzug.zzb(com.google.firebase:firebase-auth##21.1.0:4)
at com.google.android.gms.internal.firebase-auth-api.zzvf.zzM(com.google.firebase:firebase-auth##21.1.0:5)
at com.google.android.gms.internal.firebase-auth-api.zzvf.zzs(com.google.firebase:firebase-auth##21.1.0:4)
at com.google.android.gms.internal.firebase-auth-api.zzxb.zzm(com.google.firebase:firebase-auth##21.1.0:6)
at com.google.android.gms.internal.firebase-auth-api.zzvr.zzc(com.google.firebase:firebase-auth##21.1.0:1)
at com.google.android.gms.internal.firebase-auth-api.zzyc.run(com.google.firebase:firebase-auth##21.1.0:1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at java.lang.Thread.run(Thread.java:1012)
I would like someway to handle this exception but I am not able to find a way. Am I missing something obvious?
Here is my implementation
ProfileViewModel.kt
override fun buildLoginIntent(): Intent {
val authUILayout = AuthMethodPickerLayout.Builder(R.layout.auth_ui)
.setGoogleButtonId(R.id.btn_gmail)
.setEmailButtonId(R.id.btn_email)
.setFacebookButtonId(R.id.btn_facebook)
.build()
val googleScopes = arrayListOf(
"https://www.googleapis.com/auth/userinfo.profile",
"https://www.googleapis.com/auth/userinfo.email"
)
val intent = AuthUI.getInstance().createSignInIntentBuilder()
.setAvailableProviders(
listOf(
AuthUI.IdpConfig.EmailBuilder().build(),
AuthUI.IdpConfig.GoogleBuilder().setScopes(googleScopes).build(),
AuthUI.IdpConfig.FacebookBuilder().build()
)
)
.enableAnonymousUsersAutoUpgrade()
.setLogo(R.mipmap.ic_launcher)
.setAuthMethodPickerLayout(authUILayout)
.build()
return intent
}
#SuppressLint("RestrictedApi")
override fun onLoginResult(result: FirebaseAuthUIAuthenticationResult) {
// Handle result
}
ProfileUI.kt
Composable UI where I launch the intent
val loginLauncher = rememberLauncherForActivityResult(
profileViewModel.buildLoginActivityResult()
) { result ->
if (result != null) {
profileViewModel.onLoginResult(result = result)
}
}
if (isAnonymousUser) {
SignInUI() {
loginLauncher.launch(profileViewModel.buildLoginIntent())
}
}
However, when I try to use my Facebook login with the same email that I have previously authenticated using Gmail, I am getting the below error.
This credential is already associated with a different user account.
That's the expected behavior since your user was first time authenticated with Google. When you authenticate a user in Firebase with Google, there is a user created that contains the data that corresponds to that particular provider. If you try to use that data to authenticate to Facebook, the authentication will fail, because the user was already created with another provider, hence the error.
A solution for this kind of situation would be to check if the user already exists, before authenticating it. If the user already exists, then you have to read the provider and display a message to the user, so it can choose the right authentication provider.
Another option might be to allow the creation of different accounts for different providers. You can find this option which is called "Create multiple accounts for each identity provider" right inside the Firebase Console, in the Settings tab inside the Authentication.
Apologies in advance for the rookie question - I've been trying at this query for a while now and turn to Stack Overflow with the hope of resolving this small issue.
The Problem
In my case, it seems that the Firebase method to sign the user in through email (signInWithEmailAndPassword) doesn't seem to work.
My current setup is this:
AuthFragment, a Fragment which calls methods from its parent Activity, AuthActivity.
AuthActivity, an Activity which contains several methods/self-defined functions:
validate(), which checks if the email and password inputs are valid
signIn(), which uses Firebase's signInWithEmailAndPassword method to sign the user in.
The following are snippets of my code:
AuthActivity.kt
package com.example.myApplication
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
class AuthActivity : AppCompatActivity() {
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_auth)
}
fun validate(email: String?, password: String?): Boolean {
return ((email != null) && (password != null)) && (password.length >= 5) && (email.contains("#"))
}
fun signIn(email: String, password: String) {
auth = Firebase.auth
Log.d("Auth", "Attempting to authenticate...")
auth.signInWithEmailAndPassword(email, password).addOnCompleteListener(this) { task ->
Log.d("Auth", "Result supposedly received.")
if (task.isSuccessful) {
Log.d("Auth", "User authentication successful.")
Toast.makeText(this, task.result.toString(), Toast.LENGTH_LONG).show()
} else {
Log.d("Auth", "User authentication failed.")
Toast.makeText(this, "User authentication failed. Please try again.", Toast.LENGTH_LONG).show()
}
}
}
}
AuthFragment.kt
package com.example.myApplication
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.TextView
import android.widget.Toast
class AuthFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val root = inflater.inflate(R.layout.fragment_auth, container, false)
val emailField = root.findViewById<TextView>(R.id.auth_emailField)
val passwordField = root.findViewById<TextView>(R.id.auth_passwordField)
val signInButton = root.findViewById<Button>(R.id.auth_signInButton)
signInButton.setOnClickListener {
val authActivity = AuthActivity()
val email = emailField.text.toString()
val password = passwordField.text.toString()
val valid = authActivity.validate(email, password)
Log.d("Auth", valid.toString())
if (valid) {
authActivity.signIn(email, password)
} else {
Toast.makeText(activity, "Some fields are not properly filled. Please try again.", Toast.LENGTH_LONG).show()
}
}
return root
}
}
Expectations
Taking a look at the code in AuthActivity, I would have expected one of the following results to appear in the Logcat:
"User authentication successful."
"User authentication failed."
However, I only had this as a response in the Logcat:
I/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzaq#60b999e
All help is appreciated, thanks!
I lost a few hours on this one, so let me share my experience on this.
Gms stands for "Google Mobile Services", and its basically an addon API to Android developed by Google that allows to connect to a bunch of Google-provided services. If you use flutter, this is probably wrapped by flutter packages you use such as firebase_auth, flutter_facebook_login or/and google_sign_in.
This error may sometimes be handled by the higher level components, so if you have that error, it doesn't mean your configuration is wrong or it won't work. In my case I had this error with successful end result when I was logging using Google Sign in, something like this:
info flutter.tools W/BiChannelGoogleApi( 4106): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#8116b2c
info flutter.tools D/FirebaseAuth( 4506): Notifying id token listeners about user ( lCZZZZJELWhGUZZZZB3vDklZZZZ2 ).
info flutter.tools D/FirebaseAuth( 4506): Notifying auth state listeners about user ( lCZZZZJELWhGUZZZZB3vDklZZZZ2 ).
info flutter.tools I/flutter ( 4506): FirebaseUser({uid: lCZZZZJELWhGUZZZZB3vDklZZZZ2, photoUrl: https://lh5.googleusercontent.com/-ZZzir_P-ENw/AAAAAAAAAAI/AAAAAAAAAAA/PpxhiXg_ISk/s96-c/photo.jpg, isAnonymous: false, etc....
I have a dart call print(fireUser); in my code so we see it's a success.
But in the case of Facebook Auth, I just had this, and nothing happened after that, but on the Facebook server side, login was succeeding as I could see events in Facebook dev console.
info flutter.tools W/BiChannelGoogleApi( 4106): [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.firebase.auth.api.internal.zzak#8116b2c
And nothing else after in the log, so something was stuck in the process.
My problem was I mixed two applications App Id and Secret. I'm a bonehead sometimes, but the thing is there's zero warning or specific error nowhere, so here are a list of things that can fail with Firebase and other plugins:
Make sure you have properly configured the sign-in provider (google, facebook, etc.) in Firebase console
Upgrade all flutter packages. I personnaly don't use package versions, I use all flutter packages latest version. And I use AndroidX.
In the specific case of Facebook Auth (I find Google Sign In much easier to integrate):
make sure your looking at the good app
make sure the App ID and App secret are the good one. In Facebook dev console, check the Basic Settings there.
make sure you have added the "Facebook Login" product. If you don't see it in the left menu, in Facebook dev console, check the Dashboard and add it.
in the "Facebook Login" product settings, make sure you have added the "Valid OAuth Redirect URIs" that Firebase console gives you (in the Facebook Sign-in provider config). You can check it in the "Redirect URI validator" tool lower in that page.
in the Basic Settings of the app, if you use flutter (=> mobile platforms), make sure you have an IOS section/platform and and Android section/platform. To achive that you can do it manually "Add platform", or use the Quick Starts.
in the end, the IOS section can contain only the "Bundle ID"
and the Android section should containe the "Google Play Package Name", the "Class Name" and at least one "Key Hashes" (for debug). If you don't know how to create the hash, use the "Facebook Login" quick start.
Hope this helps
We have recently switched from Google Analytics SDK to Firebase SDK in our Android app.
Before that, we used INSTALL_REFERRER to get the user's source and medium.
Now we have started an App Campaign on Google Ads and INSTALL_REFERRER no longer works, though conversions keep coming.
How do we use Firebase SDK to know that user came from Google Ads campaign?
I think you'll want to use the Play Install Referrer API.
The link above cautions that the install referrer information will be available for 90 days and to only invoke the API during the first run of the app to avoid unnecessary API calls.
Here's an example (taking from the link above), assuming you have added the library to your build.gradle file:
Initialization:
private lateinit var referrerClient: InstallReferrerClient
...
referrerClient = InstallReferrerClient.newBuilder(this).build()
referrerClient.startConnection(object : InstallReferrerStateListener {
override fun onInstallReferrerSetupFinished(responseCode: Int) {
when (responseCode) {
InstallReferrerResponse.OK -> {
// Connection established
}
InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {
// API not available on the current Play Store app
}
InstallReferrerResponse.SERVICE_UNAVAILABLE -> {
// Connection could not be established
}
}
}
override fun onInstallReferrerServiceDisconnected() {
// Try to restart the connection on the next request to
// Google Play by calling the startConnection() method.
}
})
Getting the referrer:
val response: ReferrerDetails = referrerClient.installReferrer
val referrer = response.installReferrer
val clickTimestamp = response.referrerClickTimestampSeconds
val installTimestamp = response.installBeginTimestampSeconds
Wrapping Up:
referrerClient.endConnection()
Checking for gclid (Google Ads)
if ("gclid" in referrer) {
//report to Firebase Analytics
} else {
//do something else
}
In this way, we will determine gclid only if the user has clicked on the advertisement in the browser, but if he clicked on the advertisement in the play market, then nothing will work.
An application is published on Play Store and it is using 'application data folder' for the backup-restore purpose using Drive API. Everything works fine. However, this API is about to be turned down on 6th December, 2019 according to Google's announcement. Therefore, in order to support existing users, I have been migrating to latest API according to migration guidlines and an official sample app.
I can successfully authenticate using the code (from the official link) below.
GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.requestScopes(new Scope(DriveScopes.DRIVE_APPDATA))
.build();
GoogleSignInClient client = GoogleSignIn.getClient(this, signInOptions);
// The result of the sign-in Intent is handled in onActivityResult.
startActivityForResult(client.getSignInIntent(), REQUEST_CODE_SIGN_IN);
I am also using correct scope - DriveScopes.DRIVE_APPDATA as mentioned in the official documentation.
I am also seeing correct values of 'email' and 'granted scopes' inside onActivityResult()
if (requestCode == REQUEST_CODE_SIGN_IN && resultCode == RESULT_OK) {
GoogleSignIn.getSignedInAccountFromIntent(data).addOnSuccessListener(new OnSuccessListener<GoogleSignInAccount>() {
#Override
public void onSuccess(GoogleSignInAccount googleSignInAccount) {
Log.e("TAG", "Email - " + googleSignInAccount.getEmail()); // prints correct value
Log.e("TAG", "Granted scopes - " + googleSignInAccount.getGrantedScopes()); // prints correct value
GoogleAccountCredential credential = GoogleAccountCredential.usingOAuth2(getActivity(), Collections.singleton(DriveScopes.DRIVE_APPDATA));
credential.setSelectedAccount(googleSignInAccount.getAccount());
Drive googleDriveService = new Drive.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
credential)
.setApplicationName("App Name") // Changed it for now
.build();
mDriveServiceHelper = new DriveServiceHelper(googleDriveService);
queryFiles();
}
});
}
However, whenever I try to access a backup file in queryFiles() using the code (from the official link) below,
FileList files = driveService.files().list()
.setSpaces("appDataFolder")
.setFields("nextPageToken, files(id, name)")
.setPageSize(10)
.execute();
for (File file : files.getFiles()) {
System.out.printf("Found file: %s (%s)\n",
file.getName(), file.getId());
}
It throws the following error
{
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
Kindly help me fix the error. I believe that as everything is working fine with the published version, everything should be correct in terms of configuring on Google API console.
I probably can't find ALL threads with this problem but I can try to help in a few or so.
PRIMARY ANSWER
IF you're using ProGuard same as I am. ProGuard can cause this error to happen during query. I fixed it using the following.
# Fix OAuth Drive API failure for release builds
-keep class * extends com.google.api.client.json.GenericJson { *; }
-keep class com.google.api.services.drive.** { *; }
-keepclassmembers class * { #com.google.api.client.util.Key <fields>; }
SECONDARY ANSWER
Note that you DO NOT need to use keys/tokens using the Drive rest API with Android like you may find from other solutions (it may not hurt either, but it can). It doesn't match up here to what people talk about elsewhere (here they don't know what they're talking about).
See my notes here for further info: Google Drive via OAuth release version receives dailyLimitExceededUnreg
IF you have the problem however in debug build then you did not do everything correctly. My notes should get you on the right track.
If you need further help, I might assist because of how nuts it is.
EXAMPLE OF GETTING A FILE FROM DRIVE WITH THE NEW API USE
Just see from the following link
public Task<Pair<String, String>> readFile(String fileId)
https://github.com/gsuitedevs/android-samples/blob/master/drive/deprecation/app/src/main/java/com/google/android/gms/drive/sample/driveapimigration/DriveServiceHelper.java
The id comes from the query result where the id is part of that query info attached to that which is returned from the Drive query. The id is the file id for the file you want to retrieve. Pass that in to readFile and it gives you the file contents back that you can save locally to java.io.File eg fileOutputStream.write(contents.getBytes()); the contents of which is pair.second. You would then have your hopefully (because sometimes we have more work to do) identical java.io.File.
You can see a basic query if you need one in the the link sample as well but its missing some important info because depending on what you do you may need to check if trashed, get file size, modify time, md5, set order, etc. You may need to see https://developers.google.com/drive/api/v2/reference/files/list and https://developers.google.com/drive/api/v3/reference/files etc to figure that out. If enough files, there will be a paged requirement as well.
I know using Drive from code is a bit nuts (well, it is to me anyway lol) so hang in there =)
For Documentation purposes as a troubleshooting step:
Go to
https://console.developers.google.com/project/<project-id>/apiui/api
Or for Google Scripts:
https://script.google.com/home/usersettings
Replace with the ID of your application and check that the Google Drive API is turned on.
If it isn't - make sure to get a new token after turning it on if this is the case.
When doing a Geocoderequest in the Here API for Android I get the result FORBIDDEN for any search string.
Here is a snippet of the code (Kotlin) :
class GeoListner : ResultListener <MutableList<Location>>
{
override fun onCompleted(p0: MutableList<Location>?, p1: ErrorCode?) {
Log.d(this.javaClass.toString(),"Result code of search is ${p1?.name}")
}
}
fab_search.setOnClickListener { View ->
var currentPos = GeoCoordinate(49.2849,-123.1252)
val listner : ResultListener<MutableList<Location>> = GeoListner()
val request = GeocodeRequest("Granville").setSearchArea(currentPos,5000)
if (request.execute(listner) != ErrorCode.NONE)
{
}
}
This search area and string is picked from the HERE-API documentation for Here. Also i notice that the GeocodeRequest is deprecated, but the result for GeocodeRequest2 is the same error.
Anyone ?
Regards
Trond
Summary: Please ensure that you set the APP_ID and APP_CODE in the manifest file correctly.
For the background: Developers using HERE SDK with their app are required to register for a set of HERE credentials and to specify these credentials (App_Id and App_Code) in their app's Android manifest XML file. Failure to do so results in blocked access to certain features and degradation in the quality of other services.
To obtain these credentials visit the developer portal at https://developer.here.com/plans and register for a license. Once your project is created, you can generate these credentials on your Project Details page. If you already have a plan, you can also retrieve these credentials from your Project Details page.
Note: Credentials are unique to your account and your application's package namespace. Avoid reusing credentials across multiple applications.