januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
351 stars 411 forks source link

build.gradle error for new react native version #198

Open sunilpasupuleti opened 1 year ago

sunilpasupuleti commented 1 year ago

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 commented 1 year ago

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"
}