React-native-firebase: Fail to build on android 'Could not find runtime.aar'

Created on 8 Jun 2018  路  6Comments  路  Source: invertase/react-native-firebase

Issue

Followed all the instructions in the setup guide

running react-native run-android:

> Configure project :app
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)


FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find runtime.aar (android.arch.lifecycle:runtime:1.0.3).
  Searched in the following locations:
      https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.3/runtime-1.0.3.aar

* 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 1s
3 actionable tasks: 1 executed, 2 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Environment

  1. Application Target Platform: Android
  1. Development Operating System: Windows 10

  1. React Native version: 0.55.4
  1. RNFirebase Version: 4.2.0

Most helpful comment

Solved by moving the google() to the top of the dependencies

https://stackoverflow.com/questions/50584437/android-studio-3-1-2-failed-to-resolve-runtime

All 6 comments

Solved by moving the google() to the top of the dependencies

https://stackoverflow.com/questions/50584437/android-studio-3-1-2-failed-to-resolve-runtime

Fixed my issue. Thank you!

Same here, tray to move google() up but nothing work.

repositories {
google()
jcenter()

}

That should definitely fix the error. I've used this starter kit in 2 projects and it works flawlessly.

@neoartdoo
Mine android/build.gradle is like:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'io.fabric.tools:gradle:1.25.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

Mine android/build.gradle is like, and aleluya!!!
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

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

Was this page helpful?
0 / 5 - 0 ratings