Closed bell-steven closed 4 years ago
@bell-steven Thanks for the PR! Can you please provide some details on the build error, to help us understand which problem your PR is fixing? We haven't kept up with the newer RN versions internally, so we haven't run into the error ourselves yet.
@garyp unfortunately, I couldn't get too much error information beyond this.
I upgraded RN and ran react-native run-android --variant=developmentdebug
. (Only an issue on android, not on iOS.)
I did spend some time making sure that react-native-select-contact
was indeed the culprit here, and I believe that it is (removing the package allows a build to complete). TBH, I was having a really hard time pinning down what the source of the error was. None of the open PR's seemed to solve it, and the only other thing I can think of of is that android.useDeprecatedNdk=true
in the gradle.properties file is the culprit here. (Full disclosure, I am not a native Android dev, I come from a react/web background).
The PR mirrors the android setup from the react-native-share
library (which is the basis of this module template). It seems like the android file setup is a couple of years old at this point, and something there is causing the issue.
If you need, I can try and create a minimal repo at some point. Let me know how I can help.
I'm facing the same issue.
env:
After some hours comparing this library files with other libs, i found a workaround, it's just to build and investigate what is wrong.
I can build now, with success.
what i did:
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android" package="com.streem.selectcontact" android:versionCode="1" android:versionName="1.0">
<application android:allowBackup="false" tools:replace="android:allowBackup"></application>
</manifest>
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 25)
buildToolsVersion safeExtGet('buildToolsVersion', "25.0.3")
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 25)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.facebook.react:react-native:+'
}
After that, my project is running. Some commands can be unnecessary above, i just copy and past to see this working.
I have same error.
I tried your branch but didnt work @bell-steven
"react-native": "0.62.1", "react-native-select-contact": "^1.3.2",
Manually adding
include ':react-native-select-contact'
project(':react-native-select-contact').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-select-contact/android/app')
in android/settings.gradle
fixed the issue
thanks for reply @sergeylaptev
but not fixed
added
import com.streem.selectcontact.SelectContactPackage;
(MainApplication)
implementation project(':react-native-select-contact')
(android/app/build.gradle)
and
include ':react-native-select-contact'
project(':react-native-select-contact').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-select-contact/android/app')
but still have errors. also sometime get this error
You don't need anything in the MainApplication. I said to add these 2 rows into the android/settings.gradle
:) not the android/app/build.gradle
@sergeylaptev Yeah. I tried like you said. Later i added another codes and tried again. But still have a error :)
@sergeylaptev Yeah. I tried like you said. Later i added another codes and tried again. But still have a error :)
Be sure you add it after this line...
apply from: file("../node_modules/@react-native-community....
Also, be sure the project line is this one (must include the "/app" at the end):
project(':react-native-select-contact').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-select-contact/android/app')
tried to your solution @gregoriohc debug is running but get error when create apk
Any news @bell-steven ?
@limoli I created the issue, but I am not a maintainer of this library. It's up to the maintainers to merge any PRs or decide when/how to move forward. In the meantime you can usepatch-package
or point to a fork.
having the same issue, can you help how to resolve this:
FAILURE: Build failed with an exception.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'. Could not resolve project :react-native-select-contact. Required by: project :app No matching configuration of project :react-native-select-contact was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.gradle.internal.dependency.AndroidTypeAttr' with value 'Aar' but:
- None of the consumable configurations have attributes.
I forked the repo and modifed and this is working fine for me in android and ios, please check the forked repo here. https://github.com/hazesoftco/react-native-select-contact.
so anyone having an issue with android build error, you can just use that repo using yarn add https://github.com/hazesoftco/react-native-select-contact
until the author fixed this.
thank you
Using
react-native-select-contact
with RN 0.62 causes a build error on Android. I can reproduce this with version 1.2.1+ (didn't try any of the older versions).Working on a PR to fix. (I already have a working fork here).