1

I am attaching to AWS Amplify and using this link https://aws-amplify.github.io/docs/android/start

But after adding all dependencies i am getting below error:

14:12:02.093 [ERROR] [system.err] /Users/kejriwal/AndroidStudioProjects/KaranKavach/app/src/main/java/com/amplifyframework/datastore/generated/model/AmplifyModelProvider.java:3: error: cannot find symbol
14:12:02.093 [ERROR] [system.err] import com.amplifyframework.util.Immutable;
14:12:02.093 [ERROR] [system.err]                                 ^
14:12:02.093 [ERROR] [system.err]   symbol:   class Immutable
14:12:02.093 [ERROR] [system.err]   location: package com.amplifyframework.util

I have tried any links like https://github.com/immutables/immutables/issues/141 But none helped, please provide suggestion.

Rakesh
  • 199
  • 1
  • 12

2 Answers2

2

I'm the guy who caused this problem. Sorry.

Sounds like your original generated code was from an old version of the Amplify CLI.

Around March, the Amplify Android library moved com.amplifyframework.core.Immutable to com.amplifyframework.util.Immutable. The change occurred for the 0.10.0 release of the Android library.

The CLI was updated around that time, to start generating the new import.

Amplify Android is at 1.0 now, which means interfaces are stable, and breaking changes like this are no longer allowed.

You can update your CLI with:

npm install -g @aws-amplify/cli@latest
Jameson
  • 6,400
  • 6
  • 32
  • 53
1

I don't know what kind of shi* it was, it wasted my 3 days. But now issue is resolved.(I tried cleaning project, even it didn't work.)

I deleted generated file AmplifyModelProvider.java, and rebuild the project and issue got resolved.

Rakesh
  • 199
  • 1
  • 12