awslabs / aws-mobile-appsync-sdk-android

Android SDK for AWS AppSync.
https://docs.amplify.aws/sdk/api/graphql/q/platform/android/
Apache License 2.0
105 stars 58 forks source link

com.amazonaws.appsync through error #367

Open Varun-Dagur opened 2 years ago

Varun-Dagur commented 2 years ago

classpath 'com.amplifyframework:amplify-tools-gradle-plugin:1.0.2'

apply plugin: 'com.android.application' apply plugin: 'com.amazonaws.appsync' apply plugin: 'realm-android' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'

implementation 'com.amazonaws:aws-android-sdk-appsync:3.1.1'

error: S3ObjectInput is not abstract and does not override abstract method mimeType() in S3InputObjectInterface public final class S3ObjectInput implements S3InputObjectInterface { } methods are not implemented here.

sdhuka commented 2 years ago

@Varun-Dagur Could you please try removing amplify-tools-gradle-plugin and retry. If it still repros, please add more details to repro the issue.

Varun-Dagur commented 2 years ago

@Varun-Dagur Could you please try removing amplify-tools-gradle-plugin and retry. If it still repros, please add more details to repro the issue.

build gradle : app apply plugin: 'com.android.application' apply plugin: 'com.amazonaws.appsync' apply plugin: 'realm-android' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'

android { compileSdkVersion 30 buildToolsVersion "30.0.3"

defaultConfig {
    applicationId "com.joyn.app"
    minSdkVersion 21
    targetSdkVersion 30
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }

    compileOptions {
        // Support for Java 8 features
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
buildFeatures {
    viewBinding true
}

}

dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.3.1' implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.multidex:multidex:2.0.1' implementation 'com.google.android.material:material:1.3.0'

implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'

def nav_version = "2.3.5"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"

testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

// Amplify core dependency
implementation 'com.amplifyframework:core:1.24.0'

// Support for Java 8 features
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

implementation 'com.amplifyframework:aws-api:1.24.0'
implementation 'com.amplifyframework:aws-datastore:1.24.0'
implementation 'com.amplifyframework:aws-auth-cognito:1.27.0'
implementation 'com.amazonaws:aws-android-sdk-appsync:3.1.1'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'

implementation 'com.applandeo:material-calendar-view:1.7.0'

}

buildscript { ext.kotlin_version = "1.5.0" repositories { google() jcenter()

}

dependencies {

// //classpath "com.android.tools.build:gradle:4.2.1" // classpath 'com.google.gms:google-services:4.3.8' // //classpath "com.google.gms:google-services:4.3.5" classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.google.gms:google-services:4.3.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20" classpath 'me.tatarka:gradle-retrolambda:3.2.0' // classpath 'com.amplifyframework:amplify-tools-gradle-plugin:1.0.2' classpath "io.realm:realm-gradle-plugin:10.0.1" }

repositories {
    google()
    mavenCentral()
    maven {
        url "https://plugins.gradle.org/m2/"
    }
}

dependencies {
    classpath 'com.amazonaws:aws-android-sdk-appsync-gradle-plugin:3.1.2'

}

}

allprojects { repositories { google() jcenter() maven { url "https://jitpack.io"

    }

}

}

task clean(type: Delete) { delete rootProject.buildDir } //apply plugin: 'com.amplifyframework.amplifytools'

Class 'S3ObjectInput' must either be declared abstract or implement abstract method 'localUri()' in 'S3InputObjectInterface'

sdhuka commented 2 years ago

Could you try by removing com.amazonaws:aws-android-sdk-appsync-gradle-plugin:3.1.2. For generating models use amplify codegen models

faridfor commented 2 years ago

I also have an object like this:

{
"kind": "INPUT_OBJECT",
"name": "S3ObjectInput"
}

and in generated code, instead of implementing InputType, it implements S3ObjectInterface and I get the same error. And when I change my object name(S3ObjectInterface to anything else) it works just fine!