the import com.google.maps cannot be resolved (clustering.Cluster) - android

I am trying to use clustering in my application. However on the import statements I get 'the import com.google.maps cannot be resolved (clustering.Cluster).
Also, when using ClusterManager I get 'cannot be resolved to a type'.
The rest of the google play services are working fine.

Are you using Android Studio, or Eclipse? Might need to check your gradle file (Android Studio for example) to see if you have the library/module dependencies lined up. If you are using this library (https://github.com/googlemaps/android-maps-utils) for example, your gradle file should have something like :
dependencies {
compile 'com.google.maps.android:android-maps-utils:0.3+'
}

Related

How to avoid migrating to AndroidX in react-native?

As Google APIs for Android introduced breaking changes as here I found my self un able to compile my react native android app, there are two things I need to know about:
How to avoid migrating to AndroidX and compile my project as I did before?
For example, when I have this error:
node_modules/react-native-firebase/android/src/main/java/io/invertase/firebase/ReactNativeFirebaseAppRegistrar.java:20: error: package android.support.annotation does not exist
import android.support.annotation.Keep;
how would include that missing package into build.gradle of that module?
I tried:
dependencies {
compile 'com.android.support:support-annotations:27.1.1'
}
but it did not help..
You can disable or avoid androidX with the following step
go to your android/gradle.properties file and paste or update the following
android.useAndroidX=false
android.enableJetifier=false
Although it does not update libraries we import or install, So all the libraries should be in AndroidX support otherwise project will not compile with this change I'm also having the same issue in my case project is fine but the problem is with the library called mapbox which have not support androidx I post the issue here you can check issue and comments.

include facebook sdk in android studio

I'm followed some tuts for including the FB SDK
but when I want to import
import com.facebook.FacebookSdk;
I need this for FB analytics, so I'm created the class fbanalytic :
image here
and we see it's hidden i dont know fix it
and also someone his tell that class it's not important specialy in the latest version in fb sdk ,is that correct?
currently im using latest verion :facebook-android-sdk-4.22.1
Using the Facebook SDK:
Import the sdk by adding compile dependency to build.gradle file
dependencies {
compile 'com.facebook.android:facebook-android-sdk:4.+'
}
Now when you are trying to use something from Facebook's SDK it should be AUTOMATICALLY imported to your files.
In your example you are making a new Class that does uses AppEventsLogger that is part of Facebook SDK. The import statement that you presumably wrote (import com.facebook.FacebookSDK) is grey and second import statement clearly shows that it is importing form com.facebook.* SDK.
tldr: Android Studio imports from Facebook SDK as expected.
Add in build.gladle within dependencies bracket:
compile 'com.facebook.android:facebook-android-sdk:4.+'
Might be duplicate.

Error when adding libraries on Android Studio

I'm trying to create an app for android (google Tango) that uses thrift to send some information to a client. I take a sample Tango app which runs without Thrift. Then when I add try to add some of the Thrift dependencies (like slf4j-log4j12-1.7.12.jar) I suddenly get errors like
error: package com.google.atap.tangoservice does not exist
I don't get what's wrong, it worked before...
Why does this happen, and how can I fix it?
Thank you
UPDATE
The way I added the library was by clicking right on App>new>module then I chose import jar, and selected the jar. Then I went to project structure and in dependencies I added the module of the jar I imported.
Adding it like this did not help me resolve the conflicts I had before:
import org.slf4j.Logger;
giving me the error "cannot resolve symbol 'Logger'".
And it also introduced the errors previously mentioned.
Have you tried adding a dependency to your build.gradle file like this:
dependencies {
compile 'com.google.atap.tangoservice'
}
If you are using local jar dependency then add it like this to the build.gradle:
dependencies {
compile files('libs/something_local.jar')
}

How to import GcmListenerService in android studio?

I am creating android application 'GoogleCloudMessaging'. I Have found many that 'GcmListenerService' is being used and the old method 'GCMIntentService' is now deprecated.
I have already install the Google Play service and add it into the dependency.
But when i try to import
import com.google.android.gms.gcm.GcmListenerService;
it gives error "cannot resolve symbol."
How can I import the Class?
I refer https://developers.google.com/android/reference/com/google/android/gms/gcm/GoogleCloudMessaging and
https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmListenerService.html#GcmListenerService()
and follow the things but still unable to solve the problem.
If you have already added Google Play Services to your dependencies, the issue might be its version.
Try to update the line(in your build.gradle) to:
compile 'com.google.android.gms:play-services:7.5.0'
Then sync your project.
You must include
compile 'com.google.android.gms:play-services-gcm:11.0.4'
in your build.gradle file.

Can't import ActionBarCompat from Android Support Library using Android Studio

I am using Android Studio and have followed this article from google as well as some other articles discussing how to use the new ActionBarCompat.
I have downloaded the support library (Rev. 18) in Android SDK Manager and added the following in my build.gradle
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile 'com.android.support:appcompat-v7:18.0.0'
}
Now I'm trying to import the Support Library API and extend ActionBarActivity in my code,
however, this is what showed up
which is not what it is supposed to be
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
Any Help?
I have the same problem. I followed this step to solved it, in Android Studio - Tools -> Android -> Sync Project with Gradle Files.
Edit:
Sorry, I forgot add this:
After Sync Project with Gradle Files follow this steps:
Right mouse click for your project and select Open Module Settings
After that, select dependencies tab
In the end - selec your library:
This should work.

Categories

Resources