Build failed when adding Neumorphism dependency in Android

Viewed 1226

I am trying to add Neumorphism and DayNightSwitch dependency in Android but the build failed every time.

I tried many times but I didn’t figured out what's the problem is.

The gradle plugin is 7.2 and the Gradle version is 7.0.1

Neumorphism dependency

dependencies {
    implementation 'com.github.fornewid:neumorphism:{latest_version}'
}


DayNightSwitch dependency

dependencies {
            implementation 'com.github.Mahfa:DayNightSwitch:1.4'
    }


8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.github.fornewid:neumorphism:0.3.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
       - https://repo.maven.apache.org/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
     Required by:
         project :app

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
2 Answers

Please try to specify a version for the dependency

implementation 'com.github.fornewid:neumorphism:0.3.0'

Please add Neumorphism dependecy in your app level build.gradle as below,:

implementation 'com.github.fornewid:neumorphism:0.3.0'

And add these lines inside dependencyResolutionManagement to your Settings.gradle:

repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    maven { url "https://jitpack.io" }
    jcenter() // Warning: this repository is going to shut down soon
}
Related