Glympse Api packages are not resolved despite to linking Glympse Api in gradle

163 Views Asked by At

I am running Glympse Sdk sample on my Android Studio 3.0, I am able to run the sample but finding some issue like sdk is not properly working with Studio, Please refer the below dropbox link for see screen shot:-

https://www.dropbox.com/personal?preview=Glympse.png

Project is running, but I am not able to get signed inside Glympse using any of the account and neither by Skipping login.

I am using this function for Facebook :-

public void fbLogin() {
        LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList(this.getString(R.string.fb_email), this.getString(R.string.fb_public_profile)));
        LoginManager.getInstance().registerCallback(_callbackManager, new FacebookCallback<LoginResult>() {
            @Override
            public void onSuccess(LoginResult loginResult) {
                mSocialFbToken = com.facebook.AccessToken.getCurrentAccessToken().getToken().toString();
                GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
                    @Override
                    public void onCompleted(JSONObject object, GraphResponse response) {
                        try {
                            GPrimitive profile = GlympseFactory.createFacebookAccountProfile(mSocialFbToken);
                            GlympseWrapper.instance().getGlympse().logout();
                            GlympseWrapper.instance().getGlympse().login(profile);
                            GlympseWrapper.instance().getGlympse().start();

                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                });
                Bundle parameters = new Bundle();
                parameters.putString("fields", "id, name, email, first_name,birthday,last_name,gender");
                request.setParameters(parameters);
                request.executeAsync();
            }

            @Override
            public void onCancel() {

            }

            @Override
            public void onError(FacebookException error) {
                if (error instanceof FacebookAuthorizationException) {
                    if (com.facebook.AccessToken.getCurrentAccessToken() != null) {
                        LoginManager.getInstance().logOut();
                        fbLogin();
                    }
                }
            }
        });
    }

Please refer the bellow link:-

https://www.dropbox.com/s/9ao6pl532pmumiw/glypseFbLoginProcess.png?dl=0

After execution of line:-

GPrimitive profile = GlympseFactory.createFacebookAccountProfile(mSocialFbToken);

Here, is what I got in evaluating GPrimitive Object :-

https://www.dropbox.com/s/w6n3fj0l7eq3hnx/glympsecreate.png?dl=0

My debugging got stop at this piece of call back :-

@Override
    public void eventsOccurred(GGlympse glympse, int listener, int events, Object obj) {
        if (GE.LISTENER_PLATFORM == listener) {
            if (0 != (events & GE.PLATFORM_ACCOUNT_CREATE_FAILED)) {
                // Check for a failure to create a Glympse account. This can happen for several reasons,
                // but in this case, it's most likely invalid or expired tokens from a third-party service.
                Toast.makeText(this, "Error: Federated login failed.", Toast.LENGTH_LONG).show();

                setTitle("Account Linking", false);
            }
            if (0 != (events & GE.PLATFORM_SYNCED_WITH_SERVER)) {
                // If we successfully sync with the server, then we have a valid Glympse user account and
                // up-to-date access tokens, so show the "account linking" view from which the user can
                // choose to link new accounts, unlink existing accounts or logout.
                Intent intent = new Intent(this, LinkedAccountsActivity.class);
                startActivity(intent);

                setTitle("Account Linking", false);
            }
        }
    }

Seems to be something not matching, but when I tried to evaluate GE.LISTENER_PLATFORM it said that unable to find any local variable GE

Please let me know what I need to update or place in my code so that it starts recognising the following two packages:-

  1. com.glympse.android.api
  2. com.glympse.android.core

Here is my setting.gradle file :-

include ':accountLinkingDemo' include ':GlympseApi' project(':GlympseApi').projectDir = new File('../GlympseApi')

Please let me know what I am left with, or what I am doing wrong in this. I have followed every step mentioned in Get Started Process on Glympse home page:-

https://developer.glympse.com/docs/core/client-sdk/guides/platforms/intro-android

I am new to this SDk and want to learn how it exactly works so that I can see this in my application.

I tried to resolve these compatibility issues but still Glympse Api's are not getting recognised by studio.

Have any one face this problem before? Any Help will be Appreciated!!!

Thanks.

0

There are 0 best solutions below