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

Execution failed for task ':app:nodeSetup'. #377

Closed kushitani closed 1 year ago

kushitani commented 2 years ago

I'm having trouble with a build error. It occurred when an Android project created on Windows was launched on a mac released this year.

Execution failed for task ':app:nodeSetup'.
> Could not resolve all files for configuration ':app:detachedConfiguration3'.
   > Could not find org.nodejs:node:6.7.0.
     Searched in the following locations:
       - https://plugins.gradle.org/m2/org/nodejs/node/6.7.0/node-6.7.0.pom
       - https://dl.google.com/dl/android/maven2/org/nodejs/node/6.7.0/node-6.7.0.pom
       - https://repo.maven.apache.org/maven2/org/nodejs/node/6.7.0/node-6.7.0.pom
       - https://nodejs.org/dist/v6.7.0/node-v6.7.0-darwin-arm64.tar.gz
     Required by:
         project :app

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

The development environment that is occurring. PC: macOS Monterey Version: 12.0.1 Chip: m1 pro AndroidStudio: Android Studio Arctic Fox | 2020.3.1 Patch 3 Gradle Version: 6.7.1 com.amazonaws: aws-android-sdk-appsync-gradle-plugin: 3.2.1

This seems to involve the AppSync library. Does anyone know the solution?

cmunaro commented 2 years ago

I patched that adding

android {
    ...
    node { // Undocumented magic that make everything work
        version = "16.14.2"
    }
}

I found that solution on stackoverflow but I lost the source :/ I don't know which is the cause

shubhams1612 commented 1 year ago

Hey could you resolve this issue?? having the same problem. Is it because of the M1 chip??

sudhansusekhat commented 1 year ago

@gpanshu I have tried the solution provided by @cmunaro , but is not working. Tried it and got the error with the version we used instead of 6.7.0, lets say the solution says need to put this below code on android block in app build.gradle node { // Undocumented magic that make everything work version = "16.14.2" } Did this but got error like Could not resolve org.nodejs:node:16.14.2 , same error with 16.14.2 (before 6.7.0) Please help to get the solution, I have already posted the question on stackoverflow , please have a look at the question @kushitani and @shubhams1612 did you guys find any solution? please post here if you found any

gpanshu commented 1 year ago

Hi @shubhams1612 can you advise what you are using this library for? And please paste in your dependencies for Amplify and AWS so that I can understand where the issue might be.

AhmedAshour commented 1 year ago

I have found a solution to this that worked for me:

android {
    node {
        distBaseUrl = 'https://direct.nodejs.org/dist/'
    }
}

Hope it helps anyone reading this 🙏🏻