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

build.gradle error for new react native version #198

Open
sunilpasupuleti opened this issue Jul 30, 2022 · 1 comment
Open

build.gradle error for new react native version #198

sunilpasupuleti opened this issue Jul 30, 2022 · 1 comment

Comments

@sunilpasupuleti
Copy link

Its showing https insecure;
Please allow allowInsecureProtocol = true in build.gradle
and also modify the line compile word with implementation

Here is the fixed build.gradle file

buildscript {
repositories {
jcenter { url "http://jcenter.bintray.com/"; allowInsecureProtocol = true }
maven {url "http://repo.spring.io/plugins-release/"; allowInsecureProtocol = true}
mavenCentral()
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.google.com'
}
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.4'
}

}

apply plugin: 'com.android.library'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
    minSdkVersion 16
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
}
lintOptions {
    abortOnError false
}
sourceSets {
    main {
        aidl.srcDirs = ['src/main/java']
    }
}

}

repositories {
jcenter { url "http://jcenter.bintray.com/"; allowInsecureProtocol = true }
maven {url "http://repo.spring.io/plugins-release/"; allowInsecureProtocol = true}
mavenCentral()
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.google.com'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.facebook.react:react-native:+' // From node_modules
implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0'
implementation "com.google.zxing:core:3.3.0"
}

@zhenguet
Copy link

code format

https://github.com/januslo/react-native-bluetooth-escpos-printer/blob/3ac15a7f9c44354b15395a2f4939c6c299425a15/android/build.gradle

buildscript {
    repositories {
        jcenter { url "http://jcenter.bintray.com/" 
                  allowInsecureProtocol = true
                }
        maven { url "http://repo.spring.io/plugins-release/"
                allowInsecureProtocol = true
              }
        mavenCentral()
        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.google.com'
            allowInsecureProtocol = true
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
    sourceSets {
        main {
            aidl.srcDirs = ['src/main/java']
        }
    }
}

repositories {
    jcenter { url "http://jcenter.bintray.com/" 
              allowInsecureProtocol = true
            }
    maven { url "http://repo.spring.io/plugins-release/"
            allowInsecureProtocol = true
          }
    mavenCentral()
    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.google.com'
        allowInsecureProtocol = true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.facebook.react:react-native:+'  // From node_modules
    implementation group: 'com.android.support', name: 'support-v4', version: '27.0.0'
    implementation "com.google.zxing:core:3.3.0"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants