I wrote a android app using aws mobile hub for usersign using facebook and google, but getting error

298 views Asked by At

I'am using Aws Mobile Hub to build an android application which provides facebook and Googlelogin button. I added these features using Aws mobile hub and downloaded a Sample App.When I run the application i'm getting the below mentioned error.

E/SignInView: Couldn't construct the object. Class com.amazonaws.mobile.auth.facebook.FacebookButton is not found. Please import the appropriate dependencies: com.amazonaws.mobile.auth.facebook.FacebookButton
                                                             java.lang.NoSuchMethodException: <init> [class android.content.Context]
                                                                 at java.lang.Class.getConstructor0(Class.java:2204)
                                                                 at java.lang.Class.getConstructor(Class.java:1683)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.createDependencyObject(SignInView.java:420)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.addSignInButtonsToView(SignInView.java:502)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.setUpSignInButtons(SignInView.java:282)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:317)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:159)
                                                                 at java.lang.reflect.Constructor.newInstance0(Native Method)
                                                                 at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                                                                 at android.view.LayoutInflater.createView(LayoutInflater.java:652)
                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:496)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
                                                                 at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                                                                 at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                                                                 at com.amazonaws.mobile.auth.ui.SignInActivity.onCreate(SignInActivity.java:113)
                                                                 at android.app.Activity.performCreate(Activity.java:6955)
                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
                                                                 at android.app.ActivityThread.-wrap14(ActivityThread.java)
                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                 at android.os.Looper.loop(Looper.java:154)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:6776)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
E/SignInView: Cannot construct an object of SignInButton com.amazonaws.mobile.auth.facebook.FacebookButton


E/SignInView: Couldn't construct the object. Class com.amazonaws.mobile.auth.google.GoogleButton is not found. Please import the appropriate dependencies: com.amazonaws.mobile.auth.google.GoogleButton
                                                             java.lang.NoSuchMethodException: <init> [class android.content.Context]
                                                                 at java.lang.Class.getConstructor0(Class.java:2204)
                                                                 at java.lang.Class.getConstructor(Class.java:1683)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.createDependencyObject(SignInView.java:420)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.addSignInButtonsToView(SignInView.java:502)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.setUpSignInButtons(SignInView.java:282)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:317)
                                                                 at com.amazonaws.mobile.auth.ui.SignInView.<init>(SignInView.java:159)
                                                                 at java.lang.reflect.Constructor.newInstance0(Native Method)
                                                                 at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
                                                                 at android.view.LayoutInflater.createView(LayoutInflater.java:652)
                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
                                                                 at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:496)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
                                                                 at android.view.LayoutInflater.inflate(LayoutInflater.java:378)
                                                                 at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                                                                 at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                                                                 at com.amazonaws.mobile.auth.ui.SignInActivity.onCreate(SignInActivity.java:113)
                                                                 at android.app.Activity.performCreate(Activity.java:6955)
                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126)
                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927)
                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)
                                                                 at android.app.ActivityThread.-wrap14(ActivityThread.java)
                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                 at android.os.Looper.loop(Looper.java:154)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:6776)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
E/SignInView: Cannot construct an object of SignInButton com.amazonaws.mobile.auth.google.GoogleButton

I have added all the dependencies perfectly. Below is build.gradle file

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile fileTree(include: ['*.jar'], dir: 'app/libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //Ormlite
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    //compile files('libs/YouTubeAndroidPlayerApi.jar')
    //compile 'com.github.nisrulz:screenshott:2.0.0'
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'com.android.support:support-v4:26.1.0'
    compile 'com.android.support:mediarouter-v7:26.1.0'
    compile 'com.android.support:animated-vector-drawable:26.1.0'
    //compile 'com.android.support:percent:26.1.0'
    compile 'com.android.support:customtabs:26.1.0'
    compile 'com.android.support:preference-v7:26.1.0'
    compile 'com.android.support:preference-v14:26.1.0'
    compile 'com.google.firebase:firebase-messaging:11.6.2'
    compile 'com.google.firebase:firebase-core:11.6.2'
    compile 'com.google.firebase:firebase-database:11.6.2'
    compile 'com.google.firebase:firebase-auth:11.6.2'
    compile 'com.google.firebase:firebase-config:11.6.2'
    compile 'com.google.firebase:firebase-ads:11.6.2'
    compile 'com.facebook.android:facebook-android-sdk:4.25.0'
    compile 'com.facebook.android:audience-network-sdk:4.25.0'
    compile 'com.google.android.gms:play-services-auth:11.6.2'
    //compile 'com.google.android.gms:play-services-awareness:11.6.2'
    compile 'com.android.support:multidex:1.0.2'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.blankj:utilcode:1.5.1'
    compile 'com.j256.ormlite:ormlite-android:5.0'
    compile 'com.j256.ormlite:ormlite-core:5.0'
    compile 'com.airbnb.android:lottie:2.2.5'
    compile 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2@aar'
    //compile 'com.github.lsjwzh.RecyclerViewPager:tablayoutsupport:v1.1.2@aar'
    compile 'com.evernote:android-job:1.2.1'
    compile 'com.makeramen:roundedimageview:2.2.1'
    annotationProcessor 'com.jakewharton:butterknife:8.8.1'
    compile 'com.jakewharton:butterknife:8.8.1'
    compile 'com.mindorks:placeholderview:0.7.2'
    compile 'jp.wasabeef:glide-transformations:2.0.2'
    /*compile 'com.specyci:residemenu:1.6+'*/
    //compile 'me.biubiubiu.justifytext:library:1.1'
    compile 'com.haozhang.libary:android-slanted-textview:1.2'
    //compile 'com.southernbox:RippleLayout:0.1.0'

    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'
    compile 'com.squareup.okhttp3:okhttp:3.8.1'
    //compile 'com.fivehundredpx:blurringview:1.0.0'

    compile 'pub.devrel:easypermissions:1.0.1'
    compile 'com.github.jd-alexander:LikeButton:0.2.3'

    testCompile 'junit:junit:4.12'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation project(':nineoldandroids-library-2.4.0')

    //Cognito Related dependencies
    compile 'com.amazonaws:aws-android-sdk-core:2.6.+'
    compile 'com.amazonaws:aws-android-sdk-pinpoint:2.6.+'
    compile('com.amazonaws:aws-android-sdk-mobile-client:2.6.+@aar')
            { transitive = true; }

    compile('com.amazonaws:aws-android-sdk-auth-core:2.6.+@aar') {
        transitive = true;
    }
    compile('com.amazonaws:aws-android-sdk-auth-ui:2.6.+@aar') {
        transitive = true;
    }
    compile('com.amazonaws:aws-android-sdk-auth-facebook:2.6.+@aar') {
        transitive = true;
    }
    compile('com.amazonaws:aws-android-sdk-auth-google:2.6.+@aar') {
        transitive = true;
    }

I even checked in the issue section of github repository of AWS, but couldn't find anything. Also i googled the issue, but no luck. Could you please help me to resolve this issue.

0

There are 0 answers