FirebaseRecyclerOptions throwing error - android

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

Related

Could not Resolve Symbol R After Migrating to Androidx

After migrating to Androidx,my project start displaying a red underline error which says could not resolve R.
i have Tried googling for some similar issue but yet the error
remain,
i have checked my manifest, my Res folder for error
i have novalidate/restart project
i have clean and rebuild project
i have sync gradle with android project
yet after i have done these, the error still remains
dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
// implementation 'com.google.android.material:material:1.0.0-rc01'
implementation 'com.google.android.material:material:1.1.0-alpha05'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.github.maxyou:CalendarPicker:v1.1.2'
// Ramotion
implementation 'com.ramotion.paperonboarding:paper-onboarding:1.1.3'
implementation 'com.ramotion.foldingcell:folding-cell:1.2.3'
implementation 'com.ramotion.garlandview:garland-view:0.3.3'
}
MyApplication.java
package xyz.esusku.nearbyworker;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}```
See https://twitter.com/tasomaniac/status/1103020923874131968 for the details.
Gradle Android Plugin 3.3+ no longer generates R source file. You either need to update to the IDE that supports the new binary format for the resources or downgrade the plug-in to an older version in your build.gradle.
Hope you have added these line in gradle.properties file: as you are trying to migrate existing project.
android.useAndroidX=true
android.enableJetifier=true
one more thing try removing the duplicate import-
import android.support.v7.app.AppCompatActivity; //remove this line
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

LocationRequest and LocationServices.API are not resolved

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

osmdroid setUserAgentValue Cannot resolve Method

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'

Retrofit cannot find symbol

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

com.google.android.gms.drive.DriveApi.ContentsResult cannot be resolved... But everything else can be?

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.

Categories

Resources