ASNE icon indicating copy to clipboard operation
ASNE copied to clipboard

GooglePlusSocialNetwork java.lang.NoSuchMethodError on init

Open ay-git opened this issue 11 years ago • 9 comments

On add to manager GooglePlusSocialNetwork (after init) fatal exception

E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.NoSuchMethodError: com.google.android.gms.common.api.GoogleApiClient$Builder.addApi at com.github.gorbin.asne.googleplus.GooglePlusSocialNetwork.onCreate(GooglePlusSocialNetwork.java:546) at com.github.gorbin.asne.core.SocialNetworkManager.onCreate(SocialNetworkManager.java:56) at android.support.v4.app.Fragment.performCreate(Fragment.java:1763) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:913) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1126) at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:739) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1489) at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:548) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171) at android.app.Activity.performStart(Activity.java:5143) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261) at android.app.ActivityThread.access$600(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5103) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method)

ay-git avatar Nov 23 '14 11:11 ay-git

I use com.google.android.gms:play-services:6.+ test on asne:0.3.1 and asne:0.3.3

ay-git avatar Nov 23 '14 11:11 ay-git

I have same problem in my project

andriistakhov avatar Dec 04 '14 14:12 andriistakhov

Thanks, will check it and fix...

gorbin avatar Dec 04 '14 15:12 gorbin

what the status of this bug?

andriistakhov avatar Dec 10 '14 13:12 andriistakhov

I tracked it down to this line:

https://github.com/gorbin/ASNE/blob/master/googleplus%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgithub%2Fgorbin%2Fasne%2Fgoogleplus%2FGooglePlusSocialNetwork.java#L546

If that line changes to:

.addApi(Plus.API)

Removing the 2nd argument. Than it works.

ruckus avatar Dec 10 '14 16:12 ruckus

Hi

How is this bug going on please ? I have the same issue...

mathieudebrito avatar Dec 15 '14 14:12 mathieudebrito

how is this bug going on? because I have the same problem yet, thanks!

acuevas91 avatar Feb 27 '15 15:02 acuevas91

Please check this problem, I have asne:0.3.3 with actual google services and i have this bug. I have gradle not project.

kalkub avatar Apr 11 '15 15:04 kalkub

Yea, as @ruckus said, in v6.+ of gms you need to remove options (the 2nd parameter) from addApi method.

.addApi(Plus.API)

So you need to modify the modules: go to gradle of 'googleplus' module and change play-services to the same version you have in your app.

Also you need to change some things of every module in the new versions of gradle:

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 21
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

jahertor avatar May 22 '15 10:05 jahertor