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

Android OneDrive No virtual method acquireToken #140

Closed as not planned
Closed as not planned
@TerZer

Description

@TerZer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions