can not find symbol class Builder - android

I am using loginActivity in android.
ERROR
can not find symbol class Builder
I have also imported the file: com.google.android.gms.plus.PlusClient
Error on this line
mPlusClient = new PlusClient.Builder(this, this, this).setScopes(Scopes.PLUS_LOGIN, Scopes.PLUS_ME).build();
This is auto generated file from template.
What could be the reason for this error?
EDIT
I am using android studio
minSdkVersion 11
targetSdkVersion 21

I solved in my project by downgrading play-services to:
compile 'com.google.android.gms:play-services:6.1.71'
in dependencies in gradle file.

It is not available because it is deprecated. Use GoogleApiClient instead.
Start integrating Google+ : This is the official documentation for implementing Google+ client in your Android app for login and other requirements. Please follow this and not the auto-generated code from Android studio (until the code gets updated with newer implementation).
P.S. The other answer suggests to use older version of PlusClient, which is a wrong approach. You should be using newer code Instead of using older play services.

Related

Flutter Bluetooth Serial Android embedded

I'm working with flutter and I'm getting this error while I was trying to add lutter_bluetooth_serial to the pubspec.yaml. This is the error that I get.-->"The plugin flutter_bluetooth_serial uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration." ---->I don't know how to solve this issue Can you help??? I also changed to buildgradle->defaultConfig{
minSdkVersion 19 };
flutter_blue, the author of package should update the package,to match the flutter version.
https://pub.dev/packages/flutter_blue
There is nothing you can do. Either use an other package or ask the package developer to fix the problem.
you can try
https://pub.dev/packages/flutter_blue
do your stuff, this package has function like flutter_blue.

Cannot resolve symbol 'androidx.constraintlayout.widget.ConstraintLayout'

Cannot resolve symbol 'androidx.constraintlayout.widget.ConstraintLayout'
I made an empty activity in Android Studio, ahead of nothing added, in activity_main.xml, there were so many red lines,and the prompt was: Cannot resolve symbol'
while, these code was generated by Android Studio, I tried file->invalidate cashes/restart... and installed all the SDK tools but Google series. The error was still there.
Gradle was successful, and JDK was installed.
Has anyone a solution ?
Make sure constraint layout is updated to latest version:
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
This is because your project support android legacy version, check this out in build.gradle, search for this key:
implementation 'com.android.support:appcompat-v7:28.0.0'
If confirmed, you should use the compatible version instead of the androidx version.
That is android.support.constraint.ConstraintLayout.
BTW, are you trying to follow the https://developer.android.com/guide demo? This tutorial sucks.

DriveResourceClient in Drive API not found

While working with Google Drive API in Android, I found lots of contents mentioning DriveResourceClient (class or interface). However, in my Android I didn't find the same class.
I confirmed about the version mentioned in COMPILE Section of build.gradle file too, and found that it has the same version which was mentioned in those contents.
following is the dependency used in build.gradle
compile 'com.google.android.gms:play-services-drive:11.4.2'
I am building app having minSdkVersion 23 (i.e. Android 6) and targetSdkVersion is 26 (i.e. Android 8.0).
I guess, I am missing some settings.
Any guidance would be very helpful to me.
Thanks
Per the Google Play services release notes, DriveResourceClient was only added in version 11.6.0 of Google Play services. Update your dependency if you'd like to use the new API.

Default or static interface method used without --min-sdk-version >= 24

Why do we get this error in Android Studio 3.0 RC1?
com.android.dx.cf.code.SimException:
default or static interface method used without --min-sdk-version >= 24
According to the android docs, the feature "Default and static interface methods" is compatible with Any min-sdk version.
I tracked this down to a java-library that calls Comparator.naturalOrder() - which has been added in API level 24.
So I would not expect any error-message at all for this code in a java-library.
When I use the code in my own android-app or lib java code, I see the correct lint message: "Call requires API level 24)"
Is the error-message wrong or am I missing something?
I just found out that it works as expected when I activate the D8 dexer which is planned to be the default for Android Studio 3.1
In the project gradle.properties, add:
android.enableD8=true
Now the code compiles as expected and I still get the expected linter messages.
If the java-library that you're talking about was guava, you can try to upgrade it to the latest android-specific build
implementation 'com.google.guava:guava:23.0-android'
This fixed for me
From guava v24 we have two alternative versions: Android or JRE. So, in this case you need to include the dependency as:
compile 'com.google.guava:guava:24.1-android'
Find all the details within the repo: https://github.com/google/guava
If this error occurs due to Guava, then the solution, as per the official documentation from Google is:
https://github.com/google/guava
Change the dependency to (version is current as of this writing):
api 'com.google.guava:guava:27.0-android'
This fixed the issue for me.

Cannot Implement GoogleApiClient.ServerAuthCodeCallbacks in android

I am implementing Google plus login system to my android app by following the tutorial of google developer at https://developers.google.com/identity/sign-in/android/sign-in
According to the tutorial, I should implement:
GoogleApiClient.ServerAuthCodeCallbacks
interface to enable server-side API access for the android app. However, 'ServerAuthCodeCallbacks' interface does not exist in the GoogleApiClient library, even in the latest version of the library.
Does anybody have the same issue? Or, am I missing something?
Any input will be greatly appreciated!
See the example implementation on GitHub: github.com/googleplus/gplus-quickstart-android
Your dependency on com.google.android.gms:play-services must be at least of version 7.0.0 (currently latest is version 7.5.0)
Class itself is currently placed in package com.google.android.gms.common.api in Maven sub-dependency play-services-base
So for example like this:
dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
}
Also see current Developer documentation here:
https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project

Categories

Resources