mazenrashed / Printooth

A well documented, high-level Android interface that makes printing via bluetooth printers easier
Mozilla Public License 2.0
396 stars 112 forks source link

Could not find com.github.mazenrashed:Printooth:1.2.2. #87

Closed emfrigo closed 2 years ago

emfrigo commented 2 years ago

Im trying to implement the library, and i have thir error

Could not find com.github.mazenrashed:Printooth:1.2.2.
Required by:
    project :app
Search in build.gradle files 

this ir my gradle.build at proyect level:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        mavenCentral()
        maven{
            setUrl("https://jitpack.io")
        }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
    }
}

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

and to my module level:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'kotlin-parcelize'
}

android {
    compileSdk 30

    defaultConfig {
        applicationId "com.libertecno.paymentcollector"
        minSdk 21
        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'
    }

    dataBinding {
        enabled = true
    }
}

dependencies {
    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.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
    implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'
    kapt 'androidx.room:room-compiler:2.3.0'
    implementation 'androidx.room:room-runtime:2.3.0'

    implementation 'com.google.zxing:core:3.4.1'
    implementation 'com.journeyapps:zxing-android-embedded:4.2.0@aar'

    implementation 'com.github.mazenrashed:Printooth:1.2.2'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
emfrigo commented 2 years ago

This would require changing the settings.gradle in the Android project.

Replace the line: repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) with repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)

That's a gradle setting which allows this to work.