Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't run npx react-native run-android --variant=release after installing react-native-firebase packages #6079

Closed
3 of 10 tasks
emadbaqeri opened this issue Feb 16, 2022 · 6 comments
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@emadbaqeri
Copy link

emadbaqeri commented Feb 16, 2022

I have installed and tested the react-native-firebase tools in my react-native project everything was working fine until I decide to run the
commend,

npx react-native run-android --variant=release

for testing my app before releasing it to the store.

Describe your issue here
While I'm trying to install the debug version of the application on the phone and test the app everything works fine but while I'm trying to run the app in production mode I mean release variant mode to test, it fails while I'm running the npx react-native run-android --variant=release

Project Files

Javascript

Click To Expand

package.json:

{
  "name": "appname",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    "pretty": "npx prettier --write ."
  },
  "rnpm": {
    "assets": [
      "./assets/fonts/"
    ]
  },
  "dependencies": {
    "@apollo/client": "^3.4.8",
    "@apollo/react-components": "^4.0.0",
    "@babel/preset-typescript": "^7.15.0",
    "@eva-design/eva": "^2.1.1",
    "@notifee/react-native": "^4.1.0",
    "@react-native-async-storage/async-storage": "^1.15.7",
    "@react-native-community/datetimepicker": "^3.5.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/app": "^14.3.0",
    "@react-native-firebase/firestore": "^14.3.1",
    "@react-native-firebase/in-app-messaging": "^14.3.1",
    "@react-native-firebase/messaging": "^14.3.0",
    "@react-navigation/bottom-tabs": "^5.11.15",
    "@react-navigation/devtools": "^6.0.2",
    "@react-navigation/drawer": "^5.12.9",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.14.9",
    "@types/apollo-upload-client": "^14.1.0",
    "@types/react-native-calendar-picker": "^7.0.2",
    "@types/react-native-push-notification": "^7.3.3",
    "@types/react-navigation": "^3.4.0",
    "@ui-kitten/components": "^5.1.1",
    "apollo-link-ws": "^1.0.20",
    "apollo-upload-client": "^16.0.0",
    "date-fns": "^2.25.0",
    "dotenv": "^10.0.0",
    "formik": "^2.2.9",
    "graphql": "^15.5.1",
    "graphql-ws": "^5.5.5",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.21",
    "moment": "^2.29.1",
    "native-base": "^3.2.0",
    "react": "17.0.1",
    "react-native": "0.64.1",
    "react-native-calendar-picker": "^7.1.2",
    "react-native-config": "^1.4.3",
    "react-native-dotenv": "^3.2.0",
    "react-native-flash-message": "^0.2.0",
    "react-native-flipper": "^0.111.0",
    "react-native-flipper-apollo-devtools": "^0.0.2",
    "react-native-gesture-handler": "^2.2.0",
    "react-native-get-random-values": "^1.7.2",
    "react-native-image-crop-picker": "^0.36.2",
    "react-native-paper": "^4.9.2",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^2.3.1",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.10.2",
    "react-native-shared-element": "^0.8.3",
    "react-native-svg": "^12.1.1",
    "react-native-vector-icons": "^8.1.0",
    "react-navigation-shared-element": "^3.1.3",
    "recoil": "^0.4.1",
    "rn-async-storage-flipper": "^0.0.10",
    "styled-components": "^5.3.1",
    "styled-system": "^5.1.5",
    "subscriptions-transport-ws": "^0.11.0",
    "uuid": "^8.3.2",
    "yup": "^0.32.9"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@types/date-fns": "^2.6.0",
    "@types/graphql": "^14.5.0",
    "@types/jest": "^26.0.23",
    "@types/lodash": "^4.14.175",
    "@types/moment": "^2.13.0",
    "@types/react-native": "^0.64.5",
    "@types/react-native-vector-icons": "^6.4.8",
    "@types/react-test-renderer": "^16.9.2",
    "@types/recoil": "0.0.9",
    "@types/uuid": "^8.3.1",
    "@types/yup": "^0.29.13",
    "babel-jest": "^26.6.3",
    "eslint": "^7.14.0",
    "eslint-config-prettier": "^8.3.0",
    "husky": "^4.2.3",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "pretty-quick": "^2.0.1",
    "react-test-renderer": "17.0.1",
    "typescript": "^4.3.5"
  },
  "resolutions": {
    "@types/react": "^17"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ]
  }
}

firebase.json for react-native-firebase v6:

{
  "react-native": {
    "android_task_executor_maximum_pool_size": 10,
    "android_task_executor_keep_alive_seconds": 3
  }
}

iOS

Click To Expand

ios/Podfile:

  • I'm using Pods and my Podfile looks like:
  • I'm not using Pods
# N/A

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

buildscript {
    ext {
        buildToolsVersion = '29.0.3'
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = '20.1.5948944'
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath('com.android.tools.build:gradle:4.1.0')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath('com.google.gms:google-services:4.3.10')
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        maven {
            url("$rootDir/../node_modules/@notifee/react-native/android/libs")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

android/app/build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' // <- Add this line

import com.android.build.OutputFile

/**
 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
 * and bundleReleaseJsAndAssets).
 * These basically call `react-native bundle` with the correct arguments during the Android build
 * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
 * bundle directly from the development server. Below you can see all the possible configurations
 * and their defaults. If you decide to add a configuration block, make sure to add it before the
 * `apply from: "../../node_modules/react-native/react.gradle"` line.
 *
 * project.ext.react = [
 *   // the name of the generated asset file containing your JS bundle
 *   bundleAssetName: "index.android.bundle",
 *
 *   // the entry file for bundle generation. If none specified and
 *   // "index.android.js" exists, it will be used. Otherwise "index.js" is
 *   // default. Can be overridden with ENTRY_FILE environment variable.
 *   entryFile: "index.android.js",
 *
 *   // https://reactnative.dev/docs/performance#enable-the-ram-format
 *   bundleCommand: "ram-bundle",
 *
 *   // whether to bundle JS and assets in debug mode
 *   bundleInDebug: false,
 *
 *   // whether to bundle JS and assets in release mode
 *   bundleInRelease: true,
 *
 *   // whether to bundle JS and assets in another build variant (if configured).
 *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
 *   // The configuration property can be in the following formats
 *   //         'bundleIn${productFlavor}${buildType}'
 *   //         'bundleIn${buildType}'
 *   // bundleInFreeDebug: true,
 *   // bundleInPaidRelease: true,
 *   // bundleInBeta: true,
 *
 *   // whether to disable dev mode in custom build variants (by default only disabled in release)
 *   // for example: to disable dev mode in the staging build type (if configured)
 *   devDisabledInStaging: true,
 *   // The configuration property can be in the following formats
 *   //         'devDisabledIn${productFlavor}${buildType}'
 *   //         'devDisabledIn${buildType}'
 *
 *   // the root of your project, i.e. where "package.json" lives
 *   root: "../../",
 *
 *   // where to put the JS bundle asset in debug mode
 *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
 *
 *   // where to put the JS bundle asset in release mode
 *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in debug mode
 *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
 *
 *   // where to put drawable resources / React Native assets, e.g. the ones you use via
 *   // require('./image.png')), in release mode
 *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
 *
 *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
 *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
 *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
 *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
 *   // for example, you might want to remove it from here.
 *   inputExcludes: ["android/**", "ios/**"],
 *
 *   // override which node gets called and with what additional arguments
 *   nodeExecutableAndArgs: ["node"],
 *
 *   // supply additional arguments to the packager
 *   extraPackagerArgs: []
 * ]
 */

project.ext.react = [
    enableHermes: false,  // clean and rebuild if changing
]

apply from: '../../node_modules/react-native/react.gradle'

/**
 * Set this to true to create two separate APKs instead of one:
 *   - An APK that only works on ARM devices
 *   - An APK that only works on x86 devices
 * The advantage is the size of the APK is reduced by about 4MB.
 * Upload all the APKs to the Play Store and people will download
 * the correct one based on the CPU architecture of their device.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Run Proguard to shrink the Java bytecode in release builds.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore.
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US.  Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

/**
 * Whether to enable the Hermes VM.
 *
 * This should be set on project.ext.react and mirrored here.  If it is not set
 * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
 * and the benefits of using Hermes will therefore be sharply reduced.
 */
def enableHermes = project.ext.react.get('enableHermes', false)

android {
    ndkVersion rootProject.ext.ndkVersion

    compileSdkVersion rootProject.ext.compileSdkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        configurations.all {
            resolutionStrategy { force 'androidx.work:work-runtime:2.6.0' }
        }
        applicationId 'com.appname'
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName '1.0'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include 'armeabi-v7a', 'x86', 'arm64-v8a', 'x86_64'
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        release {
            if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
                storeFile file(MYAPP_UPLOAD_STORE_FILE)
                storePassword MYAPP_UPLOAD_STORE_PASSWORD
                keyAlias MYAPP_UPLOAD_KEY_ALIAS
                keyPassword MYAPP_UPLOAD_KEY_PASSWORD
            }
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.debug
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
            def versionCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)
            }
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleDynamicVersion
    implementation 'com.facebook.react:react-native:+'  // From node_modules

    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'

    implementation platform('com.google.firebase:firebase-bom:29.0.4')
    implementation 'com.google.firebase:firebase-analytics'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    if (enableHermes) {
        def hermesPath = '../../node_modules/hermes-engine/android/'
        debugImplementation files(hermesPath + 'hermes-debug.aar')
        releaseImplementation files(hermesPath + 'hermes-release.aar')
    } else {
        implementation jscFlavor
    }
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
    from configurations.compile
    into 'libs'
}

apply from: file('../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle'); applyNativeModulesAppBuildGradle(project)
apply from: '../../node_modules/react-native-vector-icons/fonts.gradle'

android/settings.gradle:

rootProject.name = 'univarsity'
include ':react-native-get-random-values'
project(':react-native-get-random-values').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-get-random-values/android')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-notification/android')
include ':react-native-shared-element'
project(':react-native-shared-element').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-shared-element/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-safe-area-context/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

MainApplication.java:

package com.univarsity;

import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import org.linusu.RNGetRandomValuesPackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.ijzerenhein.sharedelement.RNSharedElementPackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.soloader.SoLoader;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.facebook.react.bridge.JSIModulePackage;
import com.swmansion.reanimated.ReanimatedJSIModulePackage;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost =
      new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
          return BuildConfig.DEBUG;
        }

        @Override
        protected List<ReactPackage> getPackages() {
          @SuppressWarnings("UnnecessaryLocalVariable")
          List<ReactPackage> packages = new PackageList(this).getPackages();
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // packages.add(new MyReactNativePackage());
          return packages;
        }

        @Override
        protected String getJSMainModuleName() {
          return "index";
        }

        @Override
        protected JSIModulePackage getJSIModulePackage() {
            return new ReanimatedJSIModulePackage(); // <- add
        }
        };


  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
  }

  /**
   * Loads Flipper in React Native templates. Call this in the onCreate method with something like
   * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
   *
   * @param context
   * @param reactInstanceManager
   */
  private static void initializeFlipper(
      Context context, ReactInstanceManager reactInstanceManager) {
    if (BuildConfig.DEBUG) {
      try {
        /*
         We use reflection here to pick up the class that initializes Flipper,
        since Flipper library is not available in release mode
        */
        Class<?> aClass = Class.forName("com.univarsity.ReactNativeFlipper");
        aClass
            .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
            .invoke(null, context, reactInstanceManager);
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
      } catch (NoSuchMethodException e) {
        e.printStackTrace();
      } catch (IllegalAccessException e) {
        e.printStackTrace();
      } catch (InvocationTargetException e) {
        e.printStackTrace();
      }
    }
  }
}

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.univarsity">

  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.CAMERA" />


  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:usesCleartextTraffic="true" android:theme="@style/AppTheme">
    <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:exported="true" android:windowSoftInputMode="adjustResize">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>


Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 14.3.0
  • Firebase module(s) you're using that has the issue:
    • @react-native-firebase/app@14.3.0
    • @react-native-firebase/firestore@14.3.1
    • @react-native-firebase/in-app-messaging@14.3.1
    • @react-native-firebase/messaging@14.3.0
  • Are you using TypeScript?
    • typescript@4.3.5


@emadbaqeri emadbaqeri added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Feb 16, 2022
@mikehardy
Copy link
Collaborator

Hi there!
A couple things -
1- not sure why you wouldn't include the error message? It means I can't really help https://stackoverflow.com/help/how-to-ask
2- not sure why you'd release a new app but base it on react-native 0.64? We're on 0.67.x now https://react-native-community.github.io/upgrade-helper/

I run a release build of react-native-firebase as part of testing really frequently, so you'll have to post a minimal reproducible repro of the failure or I have to assume this is a non-actionable project-specific problem that won't result in a change to the module

-- test: https://github.com/mikehardy/rnfbdemo/blob/5832610cea363bba18be94d08f49c0e846bdfb0d/make-demo.sh#L242
-- general repro guidance https://stackoverflow.com/help/minimal-reproducible-example

If you can produce a minimal reproducible example with an android release build failure of course we can reopen, otherwise hopefully the make-demo script helps a bit in generating a project that works, so you can see maybe where your project is having problems

@emadbaqeri
Copy link
Author

Hey @mikehardy, sorry I just forgot to include the error this is the whole out put from while I'm running the command,

➜  frontend git:(feature/chat-system) ✗ npm run android -- --variant=release

> univarsity@0.0.1 android
> react-native run-android "--variant=release"

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1478 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...

> Configure project :notifee_react-native
:notifee_react-native package.json found at /home/emad/projects/univarsity/frontend/node_modules/@notifee/react-native/package.json
:notifee_react-native:version set from package.json: 4.1.0 (4,1,0 - 4001000)
:notifee_react-native:android.compileSdk using custom value: 30
:notifee_react-native:android.targetSdk using custom value: 30
:notifee_react-native:android.minSdk using custom value: 21
:notifee_react-native:reactNativeAndroidDir /home/emad/projects/univarsity/frontend/node_modules/react-native/android

> Configure project :react-native-firebase_app
:react-native-firebase_app package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:firebase.bom using default value: 29.0.4
:react-native-firebase_app:play.play-services-auth using default value: 20.0.1
:react-native-firebase_app package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_app:version set from package.json: 14.3.1 (14,3,1 - 14003001)
:react-native-firebase_app:android.compileSdk using custom value: 30
:react-native-firebase_app:android.targetSdk using custom value: 30
:react-native-firebase_app:android.minSdk using custom value: 21
:react-native-firebase_app:reactNativeAndroidDir /home/emad/projects/univarsity/frontend/node_modules/react-native/android

> Configure project :react-native-firebase_firestore
:react-native-firebase_firestore package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/firestore/package.json
:react-native-firebase_app package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_firestore:firebase.bom using default value: 29.0.4
:react-native-firebase_firestore package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/firestore/package.json
:react-native-firebase_firestore:version set from package.json: 14.3.1 (14,3,1 - 14003001)
:react-native-firebase_firestore:android.compileSdk using custom value: 30
:react-native-firebase_firestore:android.targetSdk using custom value: 30
:react-native-firebase_firestore:android.minSdk using custom value: 21
:react-native-firebase_firestore:reactNativeAndroidDir /home/emad/projects/univarsity/frontend/node_modules/react-native/android

> Configure project :react-native-firebase_in-app-messaging
:react-native-firebase_in-app-messaging package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/in-app-messaging/package.json
:react-native-firebase_app package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_in-app-messaging:firebase.bom using default value: 29.0.4
:react-native-firebase_in-app-messaging package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/in-app-messaging/package.json
:react-native-firebase_in-app-messaging:version set from package.json: 14.3.1 (14,3,1 - 14003001)
:react-native-firebase_in-app-messaging:android.compileSdk using custom value: 30
:react-native-firebase_in-app-messaging:android.targetSdk using custom value: 30
:react-native-firebase_in-app-messaging:android.minSdk using custom value: 21
:react-native-firebase_in-app-messaging:reactNativeAndroidDir /home/emad/projects/univarsity/frontend/node_modules/react-native/android

> Configure project :react-native-firebase_messaging
:react-native-firebase_messaging package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_app package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/app/package.json
:react-native-firebase_messaging:firebase.bom using default value: 29.0.4
:react-native-firebase_messaging package.json found at /home/emad/projects/univarsity/frontend/node_modules/@react-native-firebase/messaging/package.json
:react-native-firebase_messaging:version set from package.json: 14.3.1 (14,3,1 - 14003001)
:react-native-firebase_messaging:android.compileSdk using custom value: 30
:react-native-firebase_messaging:android.targetSdk using custom value: 30
:react-native-firebase_messaging:android.minSdk using custom value: 21
:react-native-firebase_messaging:reactNativeAndroidDir /home/emad/projects/univarsity/frontend/node_modules/react-native/android

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
                    Welcome to Metro!
              Fast - Scalable - Integrated


info Writing bundle output to:, /home/emad/projects/univarsity/frontend/android/app/build/generated/assets/react/release/index.android.bundle
info Writing sourcemap output to:, /home/emad/projects/univarsity/frontend/android/app/build/generated/sourcemaps/react/release/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 36 asset files
info Done copying assets

> Task :app:compileReleaseJavaWithJavac FAILED

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.
See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
288 actionable tasks: 3 executed, 285 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
   > Could not find lifecycle-runtime-2.2.0.jar (androidx.lifecycle:lifecycle-runtime:2.2.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime/2.2.0/lifecycle-runtime-2.2.0.jar

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 41s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installRelease -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
   > Could not find lifecycle-runtime-2.2.0.jar (androidx.lifecycle:lifecycle-runtime:2.2.0).
     Searched in the following locations:
         https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-runtime/2.2.0/lifecycle-runtime-2.2.0.jar

* Try:
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.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 41s

    at makeError (/home/emad/projects/univarsity/frontend/node_modules/execa/index.js:174:9)
    at /home/emad/projects/univarsity/frontend/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/home/emad/projects/univarsity/frontend/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
    at async Command.handleAction (/home/emad/projects/univarsity/frontend/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details. 

@emadbaqeri
Copy link
Author

And actually, I'm using react-native@0.64.0.
Should I update the react-native package?

@mikehardy
Copy link
Collaborator

With apologies,

Could not find lifecycle-runtime-2.2.0.jar (androidx.lifecycle:lifecycle-runtime:2.2.0).

This has nothing to do with this module, it looks like you have some sort of local network issue. My answer stands with regard to frequent testing on this type of build, and that you have a local problem. There is not anything we can do here to help.

Should I update the react-native package?

You should aim to be on the current stable version as a general goal, all the time. react-native 0.64 does not even compile with Xcode 13, I'm not sure why anyone would use a version that old. I would not stay on that version, personally.

@emadbaqeri
Copy link
Author

@mikehardy What kind of local network issue it could be?

@mikehardy
Copy link
Collaborator

@emadbaqeri this does not have to do with this module so I won't have the time to reply further, but I can say that you should find results on that type of error via standard web searches and/or stackoverflow - I myself have seen questions and answers for similar items and the guidance there will be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests

2 participants