DantSu / ESCPOS-ThermalPrinter-Android

Useful library to help Android developpers to print with (Bluetooth, TCP, USB) ESC/POS thermal printer.
MIT License
1.23k stars 375 forks source link

Could not find com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.0.1. #233

Closed alcadiosystem closed 2 years ago

alcadiosystem commented 2 years ago

When trying to compile in a new or existing project, it generates the following error when compiling the app `FAILURE: Build completed with 8 failures.

1: Task failed with an exception.

2: Task failed with an exception.

For a new project, my gradle config file is as follows:

`// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:7.0.1"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() mavenCentral() maven { url 'https://jitpack.io' }

}

}

task clean(type: Delete) { delete rootProject.buildDir }`

Gradle app `plugins { id 'com.android.application' }

android { compileSdk 31

defaultConfig {
    applicationId "com.example.testappprint"
    minSdk 21
    targetSdk 31
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.0.1'

}`

It should be noted that this error only appears when the compilation is carried out by calling this library, when the line of code is eliminated or commented, it compiles normally

Does anyone know how I could fix this error? error

alcadiosystem commented 2 years ago

I proceed to close this thread, dissolution and it is as follows:

Select the project view from the file viewer, the file setting.gradle is made two modifications

1) The line repositoriesMode.set (RepositoriesMode.FAIL_ON_PROJECT_REPOS) which is the original, you need to replace it with the following repositoriesMode.set (RepositoriesMode.PREFER_SETTINGS)

2) add the maven {url 'https://jitpack.io'} inside the repositories object

DantSu commented 2 years ago

Thx for your feedback, there will be helpfull !

ldavidsp commented 2 years ago

Fixed https://github.com/DantSu/ESCPOS-ThermalPrinter-Android/issues/279