Version is disabled or provided wrong application info

Hello,

I am developing an Android app with your Android SDK and have problems using the login with the Facebook SDK:

loginWithFacebookSdk(Activity context, Map<String, String> facebookFieldsMappings, List<String> permissions, CallbackManager callbackManager, AsyncCallback<BackendlessUser> responder, boolean stayLoggedIn) 

but I am always getting back the same error: “Version is disabled or provided wrong application info (application id or secret key)”. How do I resolve this?

I have

  • added <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id" /> in the manifest
  • added the apps Facebook app id (“1900918110139729”) and app secret in the social settings tab in Backendless
  • provided Facebook with an contact email address, the app domain “api.backendless.com”, a website platform with the same domain, an Android platform with my package name und my class name, made the app live (under “App Review”)
  • added the Facebook “product” called “Facebook Login”, and set the OAuth redirect URL to “https://api.backendless.com/” and activated both client and web authentification

Thank your for your help!

Kind Regards
Felix D.

Hey Felix D.

Looks like you forgot to initialize your app

Backendless.initApp( Context, application-id, secret-key, version );

where Context is an instance of android.content.Context. For instance, it may be your Android application main activity.

https://backendless.com/documentation/users/android/users_requirements.htm

Regards, Vlad

This problem is definitely not solved yet. I do initialize Backendless in a custom App class. I think that part works fine.

Sorry,

It’s strange, because as I know that error appears when at least one of AppId, SecretKey or AppVersion is invalid, or if you did not call initApp method

are you sure that you are using correct AppId, SecretKey, AppVersion in Backendless.intiApp method?

and also, do you get the error for all calls, I mean what happens when you try to fetch all Users for example?

Backendless.Persistence.of( BackendlessUser.class ).find() 

I will try it later! Do these calls DB access requests work in theory even if no user is currently logged in? Thank you for your support. :slight_smile:

yes, if you did not assign any roles/permissions for that http://take.ms/Wu1Su

Okay “great”, I found a problem indeed, as you said:

I init Backendless with this:

Backendless.initApp(context, getString(R.string.backendless_app_id), getString(R.string.backendless_app_secret), getString(R.string.backendless_version));

    &lt;string name=&quot;backendless_app_id&quot; tools:ignore=&quot;TypographyDashes&quot;&gt;38A72038-B79A-5883-FFCB-08F843D77C00&lt;/string&gt;
    &lt;string name=&quot;backendless_app_secret&quot; tools:ignore=&quot;TypographyDashes&quot;&gt;copy-pasted from the "Android Secret Key" field of the console&lt;/string&gt;
    &lt;string name=&quot;backendless_version&quot;&gt;v1&lt;/string&gt;

Backendless.getApplicationId() returns the correct ID as well.

And now that code:

Backendless.Persistence.of("test").findFirst(new AsyncCallback&lt;Map&gt;() {
            @Override
            public void handleResponse(Map map) {
                Log.i("App", "Backendless SDK: gotten test, property = \"" + map.get("property") + "\"");
            }



            @Override
            public void handleFault(BackendlessFault fault) {
                Log.e("App", "Backendless SDK: failed to get test, error = " + fault.toString());
            }
        });

returns

E/App: Backendless SDK: failed to get test, error = BackendlessFault{ code: '2002', message: 'Version is disabled or provided wrong application info (application id or secret key)' }

What am I doing wrong? It seems just like I switched some numbers but I double checked everything by now …

Oh my GOD, sorry to have bothered you! I must have missed the last character the first two times I copied the secret key. Please don’t ask how I accomplished this. :frowning:

This ticket can be closed - and marked as resolved -, thank you anyways! :slight_smile:

Have a nice day. - Felix D.

glad that it helped you =)