ckage com.netvariant.helloworld;
import retrofit.Callback;
import retrofit.http.GET;
import retrofit.http.Query;
import retrofit.Call;
public interface StackOverflowAPI {
#GET("/2.2/questions?order=desc&sort=creation&site=stackoverflow")
Call<StackOverflowQuestions> loadQuestions(#Query("tagged") String tags);}
I have included in my gradle file
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
Whats the issue?
From Retrofit 2.0.* the directy is renamed from retrofit to retrofit2 you can find it here.
updated directory path
Related
I have added import import com.firebase.ui.database.FirebaseRecyclerAdapter; and
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile'com.firebaseui:firebase-ui-database:1.1.1'
in my grade files
Still, I am unable to use FirebaseRecyclerOptions
Thanks in advance :)
Gradle dependencies
I have a high priority project under development.
I am trying to insert geo location into db so I found a service online and unfortunately LocationRequest and LocationServices.API are not resolved.
I am using the dependency 'com.google.android.gms:play-services-maps:10.2.0'
I tried adding the imports
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
You can find the code I used at this link
Seems like you need to compile the play-services-location package.
Put these into the build.gradle
ext {
playServicesVersion = '10.2.0' // update accordingly
}
dependencies {
...
compile "com.google.android.gms:play-services-maps:${playServicesVersion}"
compile "com.google.android.gms:play-services-location:${playServicesVersion}"
}
Try this
implementation 'com.google.android.gms:play-services-location:15.0.1'
in your app.gradle, and update the version regularly.
Try this implementation 'com.google.android.gms:play-services:12.0.1'
worked for me
I have used this tutorial: https://github.com/osmdroid/osmdroid/wiki/How-to-use-the-osmdroid-library
But the Map doesn't show and I get an error: setUserAgentValue Cannot resolve Method
In this Line:
org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID);
I have imported this:
import org.osmdroid.tileprovider.tilesource.TileSourceFactory;
import org.osmdroid.views.MapView;
And in my Gradle this:
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'org.osmdroid:osmdroid-android:4.3'
osmdroid4.3 is out of date, and was not supporting setUserAgent.
Upgrade to the latest version, replace with:
compile 'org.osmdroid:osmdroid-android:5.4.1:release#aar'
I'm getting this error:
com.google.android.gms.drive.DriveApi.ContentsResult cannot be resolved
But just with that one import. These all work:
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.ResultCallback;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.drive.Contents;
import com.google.android.gms.drive.Drive;
import com.google.android.gms.drive.DriveFile;
import com.google.android.gms.drive.DriveFolder.DriveFileResult;
import com.google.android.gms.drive.MetadataChangeSet;
And for some reason ContentsResult can't be found. Even doing this works:
import com.google.android.gms.drive.DriveApi.*;
And it works in the sense that it doesn't error on the import, but when I do that, ContentsResult still just cannot be found...
Has anyone had this issue before?
There is no ContentsResult class in the DriveApi package, but there is a DriveContentsResult class:
com.google.android.gms.drive.DriveApi.DriveContentsResult
See http://developer.android.com/reference/com/google/android/gms/drive/package-summary.html
The answer 'myanimal' gave you is correct. You are probably using some older version of GDAA code, since 'ContentsResult' used to be there see here. Please make also sure you are compiling with the latest 'play-services:6.5.87'. I'm not sure it you are using Android Studio. If yes, see if your 'build.gradle' config file has the dependencies right:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.google.apis:google-api-services-drive:v2-rev105-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'
}
....
....
}
Disclaimer: It is not a 'better' answer, just an extension of "myanimal's" answer below.
I am new to intellij13 and just imported my Android project into it. however get the following errors and tried adding dependencies but cannot work.
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.TextView;
those are my imports
Going out on the limb here, but you probably need to add android-support-v4.jar to your project dependencies (in the /libs folder). If you are using Gradle, then add:
dependencies {
compile 'com.android.support:support-v4:19.1.+'
compile 'com.android.support:appcompat-v7:19.+'
}
in your build.gradle file