Saurabh R
Saurabh R

Reputation: 1

Not resolving AWSAppSyncClient class

I am trying to integrate an AWSAppSyncClient client into my Android project. I have added the relevant dependencies but not able to resolve:

import com.amazonaws.services.appsync.AWSAppSyncClient;

My app's build.gradle has:

apply plugin: 'com.amazonaws.appsync'

and:

implementation('com.amazonaws:aws-android-sdk-appsync:2.8.+')

And project's build.gradle has:

classpath 'com.amazonaws:aws-android-sdk-appsync-gradle-plugin:2.8.+'

I see this error message when I try to build the app:

error: package com.amazonaws.services.appsync does not exist
import com.amazonaws.services.appsync.AWSAppSyncClient;

Upvotes: 0

Views: 442

Answers (2)

Jameson
Jameson

Reputation: 6659

You should consider using Amplify Android's GraphQL API category to talk to AppSync.

Otherwise, you need to follow the documentation to setup the AWS AppSync SDK for Android.

The correct import statement for AWSAppSyncClient is:

import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;

(Source: my team maintains this software.)

Upvotes: 1

Ayushi Khandelwal
Ayushi Khandelwal

Reputation: 336

Change your import to:

import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;

instead of:

import com.amazonaws.services.appsync.AWSAppSyncClient;

Upvotes: 0

Related Questions