'Build failed: could not resolve com.takisoft.fix:preference-v7:25.3.0.0

very new to coding. I successfully built, tested, and uploaded my very simple Android App to Google Play. But since building version 2 and trying to generate the APK, I'm running into this Build Gradle and ReleaseSigningConfig issue:

:app:writeReleaseSigningConfigVersions: 1: Task failed with an exception.

  • What went wrong: Execution failed for task ':app:dataBindingMergeDependencyArtifactsRelease'.

Could not resolve all files for configuration ':app:releaseCompileClasspath'. Could not find com.takisoft.fix:preference-v7:25.3.0.0. Required by: project :app

Note takisoft is already in build.grade (:app)...How come it can't be found?

Any advice would be SUPER appreciated, I've tried everything I could find online. Including:

  • Checking gradle offline mode
  • Updating Grade Plugins and other dependencies
  • Invalidate Cache/Restart and Syncing Gradle (painfully this also deleted Local History)

AndroidManifest

<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionCode="2"
    android:versionName="1.1"
    android:compileSdkVersion="32"
    android:compileSdkVersionCodename="12"
    package="com.AppName">


    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <application
        android:name=".AppName"
        android:allowBackup="true"
        android:icon="@drawable/blue_paw_icon"
        android:label="@string/app_name"
        android:roundIcon="@drawable/blue_paw_icon"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppName">
        <activity
            android:name=".SettingsActivity"
            android:exported="true" />

        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="preloaded_fonts"
            android:resource="@array/preloaded_fonts" />

        <receiver
            android:name=".AlarmReceiver"
            android:enabled="true"
            android:exported="true">
            <intent-filter>
                <action android:name="android.action.DISPLAY_NOTIFICATION" />
            </intent-filter>
        </receiver>
    </application>

</manifest>

build.gradle (:app)

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
 }

 android {
    signingConfigs {
       release {
            storeFile file('FILE_PATH')
            storePassword '...'
            keyAlias '...'
            keyPassword '...'
        }
    }
    compileSdk 32

    defaultConfig {
        applicationId "com.AppName"
        minSdk 16
        targetSdk 32
        versionCode 2
        versionName "1.1"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.release
    }

    signingConfigs {
        debug {
            storeFile file('FILE_PATH')
            storePassword '...'
            keyPassword '...'
            keyAlias 'AppName'
        }
        release {
            keyAlias 'AppName'
            keyPassword '...'
            storeFile file('FILE_PATH')
            storePassword '...'
        }
    }


    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release

        }
        debug {
            signingConfig signingConfigs.release
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        viewBinding true
    }
 }

 dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    implementation 'com.android.volley:volley:1.2.1'
    implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.+'
    implementation 'androidx.core:core-ktx:1.6.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    def nav_version = "2.4.1"

    implementation "androidx.navigation:navigation-fragment:$nav_version"
    implementation "androidx.navigation:navigation-ui:$nav_version"

    implementation platform('com.google.firebase:firebase-bom:26.2.0')
    implementation 'com.google.firebase:firebase-analytics'

    implementation 'com.google.firebase:firebase-messaging:23.0.2'

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.takisoft.fix:preference-v7:25.3.0.0'

}

build.gradle (project)

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.4'
        classpath 'com.google.gms:google-services:4.3.10'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10-RC"

    }
}

allprojects {
    repositories {
    google()
        mavenCentral()

}}

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


Solution 1:[1]

Thanks to @Mohsensameti realized that my build.gradle file was throwing errors because I didn't update the version code for my implementation dependencies.

For example, when the implementation ends in '$androidxVersion' or '$nav_version'...then those need to be replaced with the desired version code (e.g., 2.4.1)

Super straightforward solution that solved it immediately!!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pawz