DantSu / ESCPOS-ThermalPrinter-Android

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

ISSUE REGARDING: Getting the dependency #197

Closed ronycodex closed 3 years ago

ronycodex commented 3 years ago

Please Help!! error

DantSu commented 3 years ago

Copy paste me the two build.gradle files

juanlecg commented 3 years ago

I have same problem

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"

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

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

implementation 'com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.0.0'

What went wrong:

Execution failed for task ':app:mergeDebugNativeLibs'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.0.0. Searched in the following locations:

DantSu commented 3 years ago

I don't understand what you do. Paste me your TWO build.gradle !!

DantSu commented 3 years ago

I think you don't correctly read the documentation.

juanlecg commented 3 years ago

My gradle's copy

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"

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

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

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-android-extensions'
}
android {
    compileSdk 30

    defaultConfig {
        applicationId "com.juanle.ticketparty"
        minSdk 26
        targetSdk 30
        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 JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    ext.anko_version='0.10.8'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'com.github.DantSu:ESCPOS-ThermalPrinter-Android:3.0.0'

    implementation "org.jetbrains.anko:anko:$anko_version"

}
DantSu commented 3 years ago

Can you copy paste me the error that you get when you trying to build ?

juanlecg commented 3 years ago

FAILURE: Build completed with 7 failures.

1: Task failed with an exception.

2: Task failed with an exception.

3: Task failed with an exception.

4: Task failed with an exception.

5: Task failed with an exception.

6: Task failed with an exception.

7: Task failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 34s 19 actionable tasks: 18 executed, 1 up-to-date

DantSu commented 3 years ago
- https://dl.google.com/dl/android/maven2/com/github/DantSu/ESCPOS-ThermalPrinter-Android/3.0.0/ESCPOS-ThermalPrinter-Android-3.0.0.pom
- https://repo.maven.apache.org/maven2/com/github/DantSu/ESCPOS-ThermalPrinter-Android/3.0.0/ESCPOS-ThermalPrinter-Android-3.0.0.pom
- https://jcenter.bintray.com/com/github/DantSu/ESCPOS-ThermalPrinter-Android/3.0.0/ESCPOS-ThermalPrinter-Android-3.0.0.pom

This don't search on jitpack.io. I think is conflict with mavenCentral()

try to put maven { url 'https://jitpack.io' } between google() and mavenCentral()

juanlecg commented 3 years ago

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

}

The problem continue

FAILURE: Build completed with 7 failures.

1: Task failed with an exception.

2: Task failed with an exception.

3: Task failed with an exception.

4: Task failed with an exception.

5: Task failed with an exception.

6: Task failed with an exception.

7: Task failed with an exception.

DantSu commented 3 years ago

It's still not looking to jitpack.io. can't help you more.

ronycodex commented 3 years ago

I found the solution actually it has a simple solution add the maven url in settings.gradle . . simple as that

DantSu commented 3 years ago

Thx !