Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Android OneDrive No virtual method acquireToken #140

Closed
TerZer opened this issue Jun 11, 2018 · 2 comments
Closed

Android OneDrive No virtual method acquireToken #140

TerZer opened this issue Jun 11, 2018 · 2 comments

Comments

@TerZer
Copy link

TerZer commented Jun 11, 2018

On OneDrive API client creation it gives me this error:

E/AndroidRuntime: FATAL EXCEPTION: pool-1-thread-1
                  Process: terzer.lt.drivesapplication, PID: 14982
                  java.lang.NoSuchMethodError: No virtual method acquireToken(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/microsoft/aad/adal/PromptBehavior;Ljava/lang/String;Lcom/microsoft/aad/adal/AuthenticationCallback;)V in class Lcom/microsoft/aad/adal/AuthenticationContext; or its super classes (declaration of 'com.microsoft.aad.adal.AuthenticationContext' appears in /data/app/terzer.lt.drivesapplication-1/base.apk:classes2.dex)
                      at com.onedrive.sdk.authentication.ADALAuthenticator.getDiscoveryServiceAuthResult(ADALAuthenticator.java:556)
                      at com.onedrive.sdk.authentication.ADALAuthenticator.login(ADALAuthenticator.java:289)
                      at com.onedrive.sdk.extensions.OneDriveClient$Builder.loginAndBuildClient(OneDriveClient.java:172)
                      at com.onedrive.sdk.extensions.OneDriveClient$Builder.access$500(OneDriveClient.java:64)
                      at com.onedrive.sdk.extensions.OneDriveClient$Builder$1.run(OneDriveClient.java:147)
                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                      at java.lang.Thread.run(Thread.java:818)

One Drive class looks like this:

public class OneDrive {

    private IOneDriveClient client;

    final ADALAuthenticator adalAuthenticator = new ADALAuthenticator() {
        @Override
        public String getClientId() {
            return "nothing to see here";
        }

        @Override
        protected String getRedirectUrl() {
            return "https://localhost";
        }
    };
    public OneDrive() {
        final IClientConfig oneDriveConfig = DefaultClientConfig.createWithAuthenticator(adalAuthenticator);

        final ICallback<IOneDriveClient> callback = new ICallback<IOneDriveClient>() {
            @Override
            public void success(final IOneDriveClient result) {
                client = result;
            }

            @Override
            public void failure(final ClientException error) {
               client = null;
            }
        };

        new OneDriveClient.Builder().fromConfig(oneDriveConfig).loginAndBuildClient(MainActivity.getInstance(),  callback);
    }

I went trought internet to find the solution for this, but I didn't found it.. Sorry for bad English, not native language.

@EmmanuelMess
Copy link

EmmanuelMess commented Jan 14, 2020

Check your dependency versions to coincide with these ones:

dependencies {
compile ('com.microsoft.services.msa:msa-auth:0.8.4') {
exclude module: 'com.microsoft.services.msa'
}
compile ('com.microsoft.aad:adal:1.1.7') {
exclude module: 'com.microsoft.aad'
}
compile ('com.google.code.gson:gson:2.3.1') {
exclude module: 'com.google.code.gson'
}
}

@baywet
Copy link
Member

baywet commented Oct 2, 2024

Thank you for reaching out and for your patience. This SDK is being officially deprecated. See #172 for more information

@baywet baywet closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants