React-Native: Could not resolve all dependencies for configuration ':app:debugCompileClasspath' - react-native

I am kind of new to the react-native thing so please excuse me for maybe making stupid mistakes.
I basically tried everything I could find before posting here and by now am not sure if this is something on my end (aka me being stupid) or a bug due to recent updates somewhere.
So, my problem is the error message mentioned above which I am getting when trying to build the app (either by using react-native run-android or even with gradlew clean). I post the full error message below as well as my app/build.gradle, build.gradle and settings.gradle files.
I left all the files the way they were created by "react-native init" and "just" added the commands I had to add according to the respective libraries' installation guides.
Due to recent changes in the Firebase SDKs I had to change quite a bit when it comes to gradle version, etc. which is why I wonder if this issue has anything to do with that?!
Oh, and the version numbers:
"dependencies": {
"babel-core": "^6.26.3",
"eslint": "^4.19.1",
"fbjs": "^0.8.16",
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-firebase": "^4.1.0",
"react-native-navigation": "^1.1.458",
"react-native-vector-icons": "^4.6.0",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
}
I installed every package with yarn (yarn add react-native-vector-icons, etc.) and npm (npm install, as well as npm install react-native-vector-icons, etc.) to make sure it's not related to any of those. In between I removed the whole node_modules folder of course.
Neither did react-native link help.
It's also not limited to the mentioned react-native-vector-icons package: I removed it from my project completely and the same error just pops up for another package.
I appreciate any help and hints!
Thank you very much in advance!
Dustin
ERROR MESSAGE:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:debugCompileClasspath'.
> More than one variant of project :react-native-vector-icons matches the consumer attributes:
- Configuration ':react-native-vector-icons:debugApiElements' variant android-aidl:
- Found artifactType 'android-aidl' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-vector-icons:debugApiElements' variant android-classes:
- Found artifactType 'android-classes' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-vector-icons:debugApiElements' variant android-manifest:
- Found artifactType 'android-manifest' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-vector-icons:debugApiElements' variant android-renderscript:
- Found artifactType 'android-renderscript' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
- Configuration ':react-native-vector-icons:debugApiElements' variant jar:
- Found artifactType 'jar' but wasn't required.
- Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
- Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Required org.gradle.usage 'java-api' and found compatible value 'java-api'.
APP/BUILD.GRADLE:
apply plugin: "com.android.application"
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
* entryFile: "index.android.js",
*
* // 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 = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.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
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.seroleashed.budgetmanager"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-navigation')
compile(project(':react-native-firebase')) {
transitive = false
}
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(':react-native-vector-icons')
implementation project(':react-native-navigation')
implementation "com.android.support:appcompat-v7:27.0.1"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-firebase')
// RNFirebase required dependencies
implementation "com.google.android.gms:play-services-base:15.0.0"
implementation "com.google.firebase:firebase-core:15.0.2"
implementation "com.google.firebase:firebase-auth:15.1.0"
implementation "com.google.firebase:firebase-database:15.0.0"
implementation "com.google.firebase:firebase-messaging:15.0.2"
}
// 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 plugin: 'com.google.gms.google-services'
BUILD.GRADLE:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
SETTINGS.GRADLE:
rootProject.name = 'BudgetManager'
include ':app'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/android/app')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native

Moving the google() to the top can sometimes solve issues like this.
an example fix from your code
buildscript {
google()
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}

You can run the following command at your project's root folder
1. You need to delete both ios,android and node module folder. Run the following commands
2. > npm install //to get the node module folder
3. > react-native upgrade //to get android and ios folder
4. > react-native link // for linking the libraries
5. > react-native run android/ios

Why do I always find the answer to questions I have shortly after asking for it in a forum or on Stackoverflow? xD
Just found the solution in this post:
Apparently there is a bug in the "google-services" version that I was using.
Downgrading from
classpath 'com.google.gms:google-services:3.3.0'
to
classpath 'com.google.gms:google-services:3.2.1'
in my "build.gradle" file made the deal.

I began as #Prahbu but changed in the middle so I thought I'd post what I did as a different answer :
here is what I did (in the project's root folder as well) :
1. You need to delete both ios,android and node module folder. Afterwards, you can run the following commands
2. > npm install //to get the node module folder
3. > react-native-git-upgrade
You'll eventually stumble upon this error. In this case, delete your .babelrc (after you saved its content), you may for example rename it to .babelrc2, and replace the generated .babelrc with yours when you're done.
If the react-native-git-upgrade didn't generate the ios and android folder, run
react-native eject
And all that is left is, as per the original answer,
4. > react-native link // for linking the libraries
5. > react-native run android/ios

run cd android && ./gradlew clean

I just had this issue. For me, the fix was simply running the run command again.
react-native run-android

Related

Getting error Program type already present: io.invertase.firebase.BuildConfig when building with Gradle - Duplicate dependency

I'm currently building a react-native app, and I would like to integrate it with Firestore.
In order to do this, I need apparently to have the #react-native-firebase_app included into the application, so I added it in my app/build.gradle file:
implementation project(':#react-native-firebase_app')
But from there, I'm getting this error when building the app:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
Program type already present: io.invertase.firebase.BuildConfig
I understood from readings that it was due to some dependencies that the firebase_app might have, so I began to exclude them all:
implementation (project(':#react-native-firebase_app')) {
exclude group: "com.google.firebase", module: "firebase-common"
exclude group: "com.google.firebase", module: "firebase-core"
exclude group: "com.google.firebase", module: "firebase-bom"
exclude group: "com.facebook.react", module: "react-native"
}
But even so, I keep getting the same error, even if the #react-native-firebase_app seems not to have any dependency anymore.
Can someone help me understand how I could deal with this?
Edit: My whole build.gradle file:
apply plugin: "com.android.application"
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
* entryFile: "index.android.js",
*
* // 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 = [
entryFile: "index.js"
]
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
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
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.pilo"
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"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
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 =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(':react-native-firebase')
implementation (project(':#react-native-firebase_app')) {
exclude group: "com.google.firebase", module: "firebase-common"
exclude group: "com.google.firebase", module: "firebase-core"
exclude group: "com.google.firebase", module: "firebase-bom"
exclude group: "com.facebook.react", module: "react-native"
}
implementation project(':react-native-screens')
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-firestore:21.3.1'
implementation 'com.google.firebase:firebase-messaging:18.0.0'
implementation 'me.leolin:ShortcutBadger:1.1.21#aar'
addUnimodulesDependencies()
}
// 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 plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin.
Thank you!
Xavier.

Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (16.0.1) and runtime (17.0.0) classpath

I am working on react native. while I am running the application i am getting below error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-base' has different v
ersion for the compile (16.0.1) and runtime (17.0.0) classpath. You should manua
lly set the same version via DependencyResolution
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
This is My Code
In android/build.grdle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 22
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google() // now here
mavenLocal()
jcenter()
maven {
url 'https://maven.google.com'
name 'Google'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.29.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// Add jitpack repository (added by react-native-spinkit)
google()
maven { url "https://jitpack.io" }
mavenLocal()
jcenter()
maven {
url 'https://maven.google.com'
name 'Google'
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "28.0.0"
}
// Remove this if you get error in maps
else if(details.requested.group == 'com.google.android.gms:play-services-maps'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "16.0.0"
}
}
}
afterEvaluate {
project -> if (project.hasProperty("android")) {
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
In android/app/build.gradle
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
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
* entryFile: "index.android.js",
*
* // 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 = [
entryFile: "index.js"
]
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
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
signingConfigs {
/* Configure the release Key's here before play store build*/
config {
keyAlias 'key0'
keyPassword 'navman'
storeFile file('../keystores/PurpleSSCert')
storePassword 'navman'
}
}
defaultConfig {
applicationId "com.teletracnavman.site360"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
/* YYMMDDHHMM UTC of build. Typically use 00 minutes for release build */
versionCode 1906141700
/* Major.Minor.YYMM.DDHH */
versionName '1.3.1906.1417'
ndk {
abiFilters "armeabi-v7a", "x86"
/* No need to include "x86" in default Android app */
abiFilters "armeabi-v7a"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.config
}
debug {
debuggable true
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
productFlavors {
}
}
dependencies {
compile project(':react-native-geocoder')
compile project(':react-native-device-info')
implementation project(':react-native-i18n')
implementation project(':react-native-firebase')
implementation project(':react-native-google-analytics-bridge')
implementation project(':react-native-orientation-locker')
implementation project(':react-native-svg')
implementation project(':react-native-maps')
implementation project(':react-native-vector-icons')
implementation project(':react-native-orientation')
implementation project(':react-native-photo-view')
implementation project(':react-native-preference')
implementation(project(':react-native-camera')) {
exclude group: "com.google.android.gms"
}
implementation project(':react-native-fs')
implementation project(':rn-fetch-blob')
implementation project(':realm')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation 'com.facebook.react:react-native:+'
// From node_modules
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.0'
}
// 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 plugin: 'com.google.gms.google-services'
I was facing same issue yesterday. In my case, updating device info library to the latest version fixed this issue.
npm install --save react-native-device-info#2.1.2
The root cause is related migration to Androidx, google play service updated to androidX
If you are using real-native-info, please upgrade. It will solve your problem with 2.1.2
yarn upgrade react-native-device-info#2.1.2
cd android && gradlew clean
react-native run-android
See here apply link
A similar question to this question
Apply Note: Upgrading com.google.android.gms to 17.0.0 will cause many
problems.
This solution will help you.
As mentioned here adding the following line at the bottom of your app's build.gradle can solve your problem.
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

Unable to run project after installing React-Native-firebase

I recently install react-native-firebase package with my react native project and follow all the necessary steps from official documentation but after building my project its saying ##you attempted to use a firebase module thats not install on your android project by calling firebase.auth() ##
I tried:
1.delete my build file from from android/app folder and build again
2.update my Google Play Services and Google Repository
But they didn't work
my build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
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.2.0'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
distributionUrl = distributionUrl.replace("bin", "all")
}
and my app/build.gradle file:
apply plugin: "com.android.application"
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
* entryFile: "index.android.js",
*
* // 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 = [
entryFile: "index.js"
]
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
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.shohay"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-firebase')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.firebase:firebase-core:16.0.4"
}
// 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 plugin: 'com.google.gms.google-services'
screen shot : image-error
Update: to use in v6: https://rnfirebase.io/auth/usage
In v5 (deprecated):
you are trying to use the Auth module without setting it up. Please refer to this to setup the auth:
https://v5.rnfirebase.io/docs/v5.x.x/auth/getting-started
And similarly, if you want other firebase modules, you will have to include each one of them. Another suggestion is to use the firebase-starter-kit that comes with everything installed.
I had the similar issue, when I run my project it showed this:
I added this code import io.invertase.firebase.auth.RNFirebaseAuthPackage; in start of MainApplication.java and new RNFirebaseAuthPackage() in getPackages() function of same file. But when I added this code implementation "com.google.firebase:firebase-auth:x.x.x" in app gradle it did not sync the gradle file and failed saying 'try again' (here x.x.x defines different versions tried by me). but when I tried 17.0.0 version, it worked fine. The reason is that you should search all the versions online and try one by one, this method always worked for me

React-Native Android Build Failure: Execution failed for task ':app:processDebugResources'. Failed to process resources

I cannot figure out what is wrong with the build. I tried the common solutions of running ./gradlew clean as well as adding the android.enableAapt2=false to the gradle.properties.
The google-services.json folder is at the /android/app level.
Im at a loss right now as to how to get past this one.
If I forgot to include something useful please lmk and I will update.
Cheers
Error Output
Configure project :app
WARNING: The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.3.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
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)
Configure project :react-native-google-analytics-bridge
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Configure project :react-native-radar
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
Task :app:processDebugGoogleServices
Parsing json file: /Users/kyletreman/18F/courier_test_app/android/app/google-services.json
/Users/kyletreman/.gradle/caches/transforms-1/files-1.1/appcompat-v7-23.0.1.aar/64df69838d7c555de168bdcf18f3be5c/res/values/values.xml:113:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/kyletreman/.gradle/caches/transforms-1/files-1.1/appcompat-v7-23.0.1.aar/64df69838d7c555de168bdcf18f3be5c/res/values/values.xml:113:5-69: AAPT: error: resource android:attr/ttcIndex not found.
error: failed linking references.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
Failed to process resources, see aapt output above for details.
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 2s
50 actionable tasks: 3 executed, 47 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
/android/app/build.gradle
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.courier_test_app.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation(project(':react-native-firebase')) {
transitive = false
}
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:support-v13:27.1.1'
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-radar')
implementation project(':react-native-google-analytics-bridge')
}
// 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 plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
/android/build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.google.gms:google-services:4.0.0'
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
}
}
From the error log I can see that appcompat-v7-23.0.1 is still being used. So, it would probably help to update resolutionStrategy:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:27.1.0'
force 'com.android.support:appcompat-v7-23.0.1'
}
}
Also you need to place that resolution strategy block in your app/build.gradle
Fixed
I was able to get help from someone familiar with the native side and he helped me sort out quite a few errors.
implementation order matters, this was the order that worked for me
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "com.android.support:support-v4:27.1.1"
implementation 'com.android.support:support-v13:27.1.1'
implementation "com.android.support:appcompat-v7:27.1.1"
implementation(project(':react-native-firebase'))
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(':react-native-radar')
implementation project(':react-native-google-analytics-bridge')
I need to move the configuration resolution strategies to the android/app/build.gradle file, mine were at the wrong level. I also had to alter versions of the support and appcompat packages. You can find dependencies via
./gradlew app:dependencies
from the android folder. The issue was one of the dependencies was pulling a older version, which was fixed by using the following in the resolutionStrategies.
force 'com.android.support:appcompat-v7:27.1.1'
The next change that needed to be made was the following line in the MainApplication.java
return BuildConfig.DEBUG;
to this
return <app_name>.BuildConfig.DEBUG;
I also removed the enableaapt2=false
The last tip I can give is that naming matters, don't rename your app unless its absolutely necessary and make sure it changes across the Main java files and AndroidMainfest.xml.
UPDATED
I realized my debugger was not connecting, it was because I removed some implementation packages that supported firebase, adding them back fixed the issue. Add the following below the firebase implementation.
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
put this code at the end of android/build.gradle
use your own numbers for the compileSdkVersion and buildToolsVersion
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}

How can I install the Android Support Library in React Native?

I got this error:
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-billing'.
> Could not resolve all dependencies for configuration ':react-native-billing:_debugCompile'.
> Could not find com.android.support:appcompat-v7:25.3.1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
> Could not find com.android.support:recyclerview-v7:25.3.1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
> Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 35.786 secs
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/android-setup.html
So, I need the android support library. How can I install it ?
EDIT:
build.grade:
buildscript {
repositories {
jcenter()
}
dependencies {
// compile project(':react-native-billing')
classpath 'com.android.tools.build:gradle:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
app/build.gradle:
apply plugin: "com.android.application"
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
* entryFile: "index.android.js",
*
* // 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,
*
* // 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: []
* ]
*/
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
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.awesomeproject"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// 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:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':react-native-billing')
compile project(':react-native-push-notification')
compile project(':react-native-sound')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile ('com.google.android.gms:play-services-gcm:8.1.0') {
force = true;
}
}
// 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'
}
I had the same problem and i was able to fix it by doing what is referenced in this question (#roachman's answer).
Could not find com.android.support:appcompat-v7:25.3.1
I got this issue and I fixed it by downgrade react-native to version 0.55.4