aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

[React Native] android build fails with Expo #2511

Closed MohibWasay closed 5 years ago

MohibWasay commented 5 years ago

Describe the bug I have a react-native expo application. I created this application using expo init appname. I initialized amplify within my app by running amplify init. I added auth, storage and graphql service. I tried running my application in my Android Nexus emulator, everything runs fine. When I try to build the application, it fails in installing the Java AWS dependencies on my expo command line

To Reproduce Steps to reproduce the behavior:

  1. Install Expo CLI, npm i -g expo-cli
  2. Create new expo application, expo init <myappname>
  3. Run the command, amplify init
  4. Run the commands npm i -s aws-amplify & npm i -s aws-amplify-react-native
  5. Run the app on my device emulator (works fine)
  6. Build the app.

Expected behavior Successfully create the build

Actual behavior

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] A problem occurred configuring root project 'android-shell-app'.
[stderr] > Could not resolve all artifacts for configuration ':classpath'.
[stderr]    
[stderr] > Could not resolve com.amazonaws:aws-java-sdk-sagemakerruntime:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-cloudtrail:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Could not resolve com.amazonaws:aws-java-sdk-cloudtrail:1.11.240.
[stderr]          > Could not get resource 'https://jcenter.bintray.com/com/amazonaws/aws-java-sdk-cloudtrail/1.11.240/aws-java-sdk-cloudtrail-1.11.240.pom'.
[stderr]             > Could not GET 'https://jcenter.bintray.com/com/amazonaws/aws-java-sdk-cloudtrail/1.11.240/aws-java-sdk-cloudtrail-1.11.240.pom'. Received status code 504 from server: Gateway Time-out
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-opsworks:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-ses:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-autoscaling:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-cloudsearch:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-cloudwatchmetrics:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-codedeploy:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-codepipeline:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-kms:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240 > com.amazonaws:aws-java-sdk-s3:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-config:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-lambda:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-ecs:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-ecr:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-cloudhsm:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-ssm:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-workspaces:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-machinelearning:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-directory:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-efs:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-codecommit:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-devicefarm:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-elasticsearch:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-waf:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-marketplacecommerceanalytics:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-inspector:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-iot:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-api-gateway:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-acm:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-gamelift:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-dms:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-marketplacemeteringservice:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-cognitoidp:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-discovery:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-applicationautoscaling:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-snowball:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-rekognition:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-polly:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-lightsail:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-stepfunctions:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-health:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-costandusagereport:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-codebuild:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-appstream:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-shield:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-batch:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-lex:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-mechanicalturkrequester:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-organizations:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-workdocs:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]       > Skipped due to earlier error
[stderr]    > Could not resolve com.amazonaws:aws-java-sdk-core:1.11.240.
[stderr]      Required by:
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240 > com.amazonaws:aws-java-sdk-cloud9:1.11.240
[stderr]          project : > com.amazonaws:aws-devicefarm-gradle-plugin:1.3 > com.amazonaws:aws-java-sdk:1.11.240 > com.amazonaws:aws-java-sdk-serverlessapplicationrepository:1.11.240
..
...
...

Desktop:

powerful23 commented 5 years ago

@MohibWasay can you give more details about how you are building the app? Do you mean you are building it in the production mode?

MohibWasay commented 5 years ago

@powerful23 Thanks for the response. Yes I am building the app in the production mode. Here is my app.json file for expo. Nothing out of the ordinary, but keep gettting this issue.

{
  "expo": {
    "name": "name",
    "slug": "name",
    "privacy": "public",
    "sdkVersion": "32.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "host.exp.exponent",
      "supportsTablet": true
    },
    "android": {
      "package": "host.exp.exponent"
    }
  }
}
powerful23 commented 5 years ago

@MohibWasay sorry to be late. Are you still having this issue? I noticed the building process complains about the Java AWS dependencies but in amplify js there is no dependency on that. Can you double check it?

MohibWasay commented 5 years ago

Hey @powerful23 apologies for being away. problem was resolved with the update of Expo version. Closing down this issue.

abhilashkgowda commented 5 years ago

https://stackoverflow.com/a/55136612/6104701

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.