expo / expo-cli

Tools for creating, running, and deploying universal Expo and React Native apps
https://docs.expo.io/workflow/expo-cli/
2.61k stars 477 forks source link

Expo eas build --profile production --platform android failing. #4442

Closed alexander01202 closed 2 years ago

alexander01202 commented 2 years ago

Summary

I am trying to run the code eas build --profile production --platform android but It fails when building. I am so confused and overwhelmed by this error. I do not even know what or where to start from.

The Error:

[stderr] 
FAILURE: Build failed with an exception.
[stderr] 
* What went wrong:
[stderr] 
Execution failed for task ':app:mergeReleaseAssets'.
[stderr] 
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
[stderr] 
   > Could not find any matches for com.transistorsoft:tslocationmanager:+ as no versions of com.transistorsoft:tslocationmanager are available.
[stderr] 
     Searched in the following locations:
[stderr] 
       - http://maven-cache-service.production.svc.cluster.local:8081/artifactory/libs-release/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - file:/home/expo/.m2/repository/com/transistorsoft/tslocationmanager/
[stderr] 
       - file:/home/expo/workingdir/build/node_modules/react-native/android/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - file:/home/expo/workingdir/build/node_modules/jsc-android/dist/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - https://dl.google.com/dl/android/maven2/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - https://repo.maven.apache.org/maven2/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - https://www.jitpack.io/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
       - file:/home/expo/workingdir/build/node_modules/@notifee/react-native/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml
[stderr] 
     Required by:
[stderr] 
         project :app > project :react-native-background-geolocation
[stderr] 
* Try:
[stderr] 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] 
* Get more help at https://help.gradle.org
[stderr] 
BUILD FAILED in 4m 47s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.

My package.json:

  "name": "Test",
  "version": "1.0.0",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "resolutions": {
    "react-native-picker-select/@react-native-picker/picker": "^2.1.0"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.2.2",
    "@gorhom/bottom-sheet": "^4.2.2",
    "@notifee/react-native": "^5.3.0",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/app": "^14.3.0",
    "@react-native-firebase/firestore": "^14.3.0",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-native-picker/picker": "^2.3.0",
    "@react-navigation/drawer": "^6.3.1",
    "@react-navigation/material-top-tabs": "^6.1.0",
    "@react-navigation/native": "^6.0.7",
    "@react-navigation/stack": "^5.14.9",
    "@rodrigogs/mysql-events": "^0.6.0",
    "babel-plugin-inline-dotenv": "^1.7.0",
    "bcrypt": "^5.0.1",
    "cors": "^2.8.5",
    "dotenv": "^16.0.1",
    "expo": "~44.0.0",
    "expo-app-loading": "^1.3.0",
    "expo-asset": "~8.4.6",
    "expo-background-fetch": "^10.1.1",
    "expo-firebase-recaptcha": "~2.1.0",
    "expo-font": "~10.0.4",
    "expo-linear-gradient": "^11.0.3",
    "expo-location": "~14.0.1",
    "expo-notifications": "^0.14.1",
    "expo-permissions": "^13.1.1",
    "expo-server-sdk": "^3.6.0",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "express": "^4.17.2",
    "firebase": "8.5",
    "flutterwave-node-v3": "^1.0.9",
    "lottie-react-native": "^5.1.3",
    "messagebird": "^3.7.2",
    "mysql": "^2.18.1",
    "native-base": "^3.3.7",
    "navigation": "^5.5.1",
    "nodemon": "^2.0.15",
    "paystack": "^2.0.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-animated-loader": "^0.0.9",
    "react-native-background-geolocation": "^4.4.4",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-dotenv": "^3.3.1",
    "react-native-dropdown-picker": "^5.4.2",
    "react-native-easy-content-loader": "^0.3.2",
    "react-native-geolocation-service": "^5.3.0-beta.4",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-image-slider-box": "^1.1.20",
    "react-native-indicators": "^0.17.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-maps": "0.29.4",
    "react-native-maps-directions": "^1.8.0",
    "react-native-multiple-select": "^0.5.7",
    "react-native-onboarding-swiper": "^1.1.4",
    "react-native-pager-view": "5.4.9",
    "react-native-paystack-webview": "^4.0.3",
    "react-native-phone-call": "^1.0.9",
    "react-native-phone-input": "^1.3.2",
    "react-native-phone-number-input": "^2.1.0",
    "react-native-picker-select": "^8.0.4",
    "react-native-progress": "^5.0.0",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-select-dropdown": "^1.8.0",
    "react-native-skeleton-content": "^1.0.24",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-svg": "12.1.1",
    "react-native-tab-view": "^3.1.1",
    "react-native-web": "0.17.1",
    "react-native-webview": "11.15.0",
    "react-navigation-transitions": "^1.0.12",
    "react-phone-input-2": "^2.14.0",
    "react-phone-number-input": "^3.1.44",
    "react-redux": "^7.2.6",
    "redux": "^4.1.2",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.4.1",
    "socket.io": "^4.4.1",
    "socket.io-client": "^4.4.1",
    "twilio": "^3.75.0",
    "validate-nin": "^2.0.6"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react-native": "^0.68.0"
  },
  "private": true
}

My app.config.js:


export default () => ({
  expo: {
    name: "test",
    slug: "test",
    version: "1.0.0",
    orientation: "portrait",
    icon: "./assets/icon.png",
    splash: {
      image: "./assets/splash.png",
      resizeMode: "contain",
      backgroundColor: "#ffffff"
    },
    updates: {
      "fallbackToCacheTimeout": 0
    },
    assetBundlePatterns: [
      "**/*"
    ],
    ios: {
      "supportsTablet": true
    },
    android: {
      useNextNotificationsApi: true,
      adaptiveIcon: {
        foregroundImage: "./assets/adaptive-icon.png",
        backgroundColor: "#FFFFFF"
      },
      package: "com.blipmoore"
    },
    web: {
      favicon: "./assets/favicon.png"
    },
    extra: {
      eas: {
        EAS_NO_VCS: process.env.EAS_NO_VCS,
      },
    }
  }
})

My app.config.js has the environment variable because I was trying to build before and I got the error: git command not found. Install it before proceeding or set EAS_NO_VCS=1 to use EAS CLI without Git (or any other version control system).

Environment

expo-env-info 1.0.4 environment info:
    System:
      OS: Windows 10 10.0.18362
    Binaries:
      Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
      npm: 8.11.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version     2020.3.0.0 AI-203.7717.56.2031.7935034
    npmPackages:
      expo: ~44.0.0 => 44.0.6
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.3 => 0.64.3
      react-native-web: 0.17.1 => 0.17.1
    Expo Workflow: managed

Please specify your device/emulator/simulator platform, model and version

N/A

Error output

No response

Reproducible demo or steps to reproduce from a blank project

I am not sure how to reproduce this exact error because I don't know what is causing it. I searched online and everyone has the same final error(Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase.) but different solutions or cause of error. This is the code I ran that caused the error:

eas build --profile production --platform android

kbrandwijk commented 2 years ago

From the react-native-background-geolocation repo, it seems you need to purchase a license for Android release builds. I presume the error might be related to that. It's definitely not related to Expo, so I suggest you open an issue in their repo if things aren't working.