cannot resolve mixpanel - after migrating to Android Studio - android

I tried migrating to Android Studio. When I use mixpanel project as library it works,but when I delete that folder and instead add in the build.gradle :
compile 'com.mixpanel.android:mixpanel-android:4.+'
compile 'com.google.android.gms:play-services:3.1+'
it doesn't work , and says
import com.mixpanel.android.mpmetrics.MixpanelAPI;
cannot resolve symbol mixpanel.

compile 'com.mixpanel.android:mixpanel-android:4.+'
change to
compile 'com.mixpanel.android:mixpanel-android:4.9.1'
worked for me

Related

How can I create own gradle dependency in android studio?

For developing android applications by using Android Studio, generally we add dependencies in build.gradle instead of adding jars or libraries.
Example given below
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
How can i create own gradle dependency in android studio?
You have to publish your library on JCenter. You can find steps of publishing it on Google.

The import com.google.android.gms.common.GooglePlayServicesClient [duplicate]

I am trying to migrate a project from Eclipse to Android Studio, the project can be build in Eclipse and was successful imported to Android Studio, however, I get Cannot resolve symbol 'GooglePlayServicesClient' error in Android Studio.
I followed the official tutorial to imported Google Play service in Android Studio, and an other package "com.google.android.gms.common.ConnectionResult" that used in my project does not have same issue. Only 'GooglePlayServicesClient' cannot be resolved.
I have also tried clean and rebuild my project, but the problem persists. What am I doing wrong?
Update:
My build.gradle
...
dependencies {
compile project(':libraryListViewAnimations')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services:7.0.0'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/commons-net-3.1-sources.jar')
compile files('libs/commons-net-3.1.jar')
compile files('libs/mail.jar')
}
GooglePlayServicesClient is obsolete and no longer included in the Google Play Services 7.x library. Google recommends using the GoogleApiClient instead.
See Accessing Google APIs in the Android developer docs:
"Note: If you have an existing app that connects to Google Play services with a subclass of GooglePlayServicesClient, you should migrate to GoogleApiClient as soon as possible."
Did you add compile 'com.google.android.gms:play-services:7.0.0' to build.gradle?
You can find more guide here . Hope this help.

Cannot resolve symbol 'GooglePlayServicesClient'

I am trying to migrate a project from Eclipse to Android Studio, the project can be build in Eclipse and was successful imported to Android Studio, however, I get Cannot resolve symbol 'GooglePlayServicesClient' error in Android Studio.
I followed the official tutorial to imported Google Play service in Android Studio, and an other package "com.google.android.gms.common.ConnectionResult" that used in my project does not have same issue. Only 'GooglePlayServicesClient' cannot be resolved.
I have also tried clean and rebuild my project, but the problem persists. What am I doing wrong?
Update:
My build.gradle
...
dependencies {
compile project(':libraryListViewAnimations')
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.android.gms:play-services:7.0.0'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/commons-net-3.1-sources.jar')
compile files('libs/commons-net-3.1.jar')
compile files('libs/mail.jar')
}
GooglePlayServicesClient is obsolete and no longer included in the Google Play Services 7.x library. Google recommends using the GoogleApiClient instead.
See Accessing Google APIs in the Android developer docs:
"Note: If you have an existing app that connects to Google Play services with a subclass of GooglePlayServicesClient, you should migrate to GoogleApiClient as soon as possible."
Did you add compile 'com.google.android.gms:play-services:7.0.0' to build.gradle?
You can find more guide here . Hope this help.

add android-support-v13.jar in Android Studio

I have been trying to add android-support-v13 in Android Studio 1.0.2
I have followed the steps here but I still get a build fail. Has anyone successfully managed to add android-support-v13.jar into Android Studio 1.0.2?
Below is my code in my gradle file.
dependencies {
compile 'com.android.support:appcompat-v7:21.0.3'
compile fileTree(dir: 'libs',include: '*.jar')
Edit: I have installed extra support library from SDK manager and I have placed the .jar in my libs folder.
according to docs at this time:
The Gradle build script dependency identifier for this library is as
follows:
com.android.support:support-v13:18.0.0
lets hope that the docs are updated.
for the latest you should use:
compile 'com.android.support:support-v13:21.0.+'
same problem android studio 1.0.2 i solve that below
compile 'com.android.support:appcompat-v7:21.0.1'
compile 'com.android.support:appcompat-v7:+'

Import scribe-1.2.1.jar in Android Studio

What are the steps to import scribe-1.2.1.jar in android studio?
I have added the jar in the lib folder and have also added it using the add library option. But when I compile I am facing compile time error.
Gradle: package org.scribe.builder does not exist
Edit your module's build.gradle file, just append one line in the dependencies scope.
dependencies {
...
compile files('libs/android-support-v4.jar')
compile files('libs/scribe-1.2.1.jar')
}
FYI: at this time Android Studio project setting did not affect the gradle build, so you must edit it yourself.
there are a user guide for gradle android plugin.

Categories

Resources