I am trying to build my RN app with eas:build. It is using gradle 7 and gradle 7 does not allow insecure protocol, I have already gone through this link. I understand that I need to add allowInsecureProtocol = true to the insecure maven repository. However, in my build gradle file I don't find any such maven repositories. So I don't know where to add this line to fix this issue. I investigated other packages gradle as well but so far I have not found any repo that has http.
This is my Gradle file,
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
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")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
jcenter() {
content {
includeModule("com.yqritc", "android-scalablevideoview")
}
}
}
}
You just need to add one line to the AndroidManifest.xml.
AndroidManifest.xml
<application
...
android:usesCleartextTraffic="true"> <= you add here
Related
I am getting this error after installing react-native-push-notification package.
here is my android.manifest file
`
I have tried changing the package version as well other results on internet but it won't work for me.
here is my build.gradle file:
`
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath 'com.google.gms:google-services:4.3.13'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
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")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}
`
I Encountered a error saying No variants found for ':expo'. Check build files to ensure at least one variant exists.
I Already download all the SDK's Clear the Project multi times but nothing work
Here is the build.gradle code
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 23
compileSdkVersion = 31
targetSdkVersion = 30
ndkVersion = "21.4.7075529"
supportLibVersion = "29.0.0"
}
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
dependencies {
classpath('com.android.tools.build:gradle:4.2.2')
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.huawei.agconnect:agcp:1.4.2.301'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
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 {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
maven { url 'https://developer.huawei.com/repo/' }
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
I am trying to implement Tipsi-stripe in my project, yet after attempting to link manually all the dependencies I am getting the following error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':tipsi-stripe:generateDebugRFile'.
> Could not resolve all files for configuration ':tipsi-stripe:debugCompileClasspath'.
> Could not find com.google.firebase:firebase-core:17.3.4.
Required by:
project :tipsi-stripe
This is my android/app/build.gradle
dependencies {
implementation 'com.google.firebase:firebase-core:17.3.4' //Added by Antek
implementation platform('com.google.firebase:firebase-bom:28.0.0') //Added by Antek
...
}
This is my android/build.gradle
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
// googlePlayServicesVersion = "16.1.0" // default: "+"
firebaseVersion = "17.3.4" // default: "+"
}
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath 'com.google.gms:google-services:4.3.5'// <- Added this line
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google() //Added by Antek
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 "https://jitpack.io" }
jcenter()
}
}
And the following are my (problem related) dependencies in package.json
"dependencies": {
...
"#react-native-firebase/app": "^11.4.1",
"#react-native-firebase/auth": "^11.4.1",
"#react-native-firebase/firestore": "^11.4.1",
"#react-native-firebase/messaging": "^11.4.1",
"tipsi-stripe": "^9.0.0"
}
How do I solve this error? I tried cleaning the gradlew with gradlew clean, however nothing seems to be working so far :(
You may not have seen the news, but Stripe just release their own React Native SDK stripe-react-native (github) recently, currently in open beta.
I highly recommend you review that package and the associate guides (eg, accept-a-payment) and shift your integration efforts towards that instead.
Recently I´ve created a new React Native App with the default.. basically everything. On the emulator, it works fine, but, when I try to install it on Android Oreo, it shows an "Application not Installed" message.
I´ve already generated a signed APK as I read in other posts regarding the same issue.
Maybe I should downgrade my RN Version..
Here´s my build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 16
compileSdkVersion = 30
targetSdkVersion = 30
}
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
}
}
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")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
Thanks in advance!
I´ve had to downgrade my React Native version to 0.63 in order to make it work.
After upgrading Android studio from 4.0.x to 4.1.3 for React native 0.64 app, I took the recommendation of upgrading gradle to 4.1.3 and followed the instruction to upgrade. However the React Native app rebuild throws an error:
Could not find com.android.tools.build:gradle:4.1.3.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.pom
Clicking the above https://jcenter.binatray.com/com/... landed on page of Forbidden. Is it the cause of the error?
I also changed gradle version in gradle-wrapper.properties to 6.8.3 from 6.7:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
Also in build.gradle, there is:
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")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven.google.com'
name 'Google'
}
}
Sync project throws the same error.
Update: build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 29
ndkVersion = "20.1.5948944"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:4.1.3')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
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")
}
jcenter()
maven { url 'https://www.jitpack.io' }
maven { url 'https://maven.google.com' } //for react-native-image-crop-picker
mavenCentral()
}
}