java.lang.IllegalArgumentException: java.lang.ClassCastException after migrating to androidx in Android Studio - android-studio

I recently migrated my example project to androidx. But, after migration, it causes 'Render Problem' in the preview. The project runs, nevertheless, but it would be helpful to get the preview working again.
As stated in the title, the render problem is caused by "java.lang.IllegalArgumentException: java.lang.ClassCastException
at java.lang.reflect.Method.invoke". A snippet is provided below.
java.lang.IllegalArgumentException: java.lang.ClassCastException#1a8e42ac
at sun.reflect.GeneratedMethodAccessor990.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108)
at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143)
at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at android.animation.StateListAnimator.start(StateListAnimator.java:188)
at android.animation.StateListAnimator.setState(StateListAnimator.java:181)
at android.view.View.drawableStateChanged(View.java:21105)
at android.view.ViewGroup.drawableStateChanged(ViewGroup.java:7101)
at com.google.android.material.appbar.AppBarLayout.drawableStateChanged(AppBarLayout.java:393)
at android.view.View.refreshDrawableState(View.java:21160)
at android.view.View.dispatchAttachedToWindow(View.java:18379)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:335)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:391)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:195)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:540)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:666)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
This is my layout file:
<?xml version="1.0" encoding="utf-8"?>
<merge>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="56dp"
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
<com.google.android.material.tabs.TabLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/tabs">
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</merge>
This is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.materialdemo"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android- optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
androidTestImplementation 'androidx.test:runner:1.2.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.constraintlayout:constraintlayout-solver:1.1.3'
implementation 'com.instabug.library:instabug:8.0.15.6-SNAPSHOT'
}
My project level build.gradle file:
// Top-level build file where you can add configuration options common
to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven{
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://jitpack.io"
}
maven {
url "https://dl.bintray.com/drummer-aidan/maven/"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Going back to implementation 'com.google.android.material:material:1.0.0' and invalidating the caches via File -> Invalidate Caches / Restart... works for me.
Also, any other theme like Theme.AppCompat.Light.NoActionBar works great, too.
Edit: I did not know that nearly no feature available in com.google.android.material:material:1.1.0-alpha06 is available in 1.0.0. So this answer is more or less useless.

Related

Android Studio GridLayout not working. Shows completely grey into Design View

I hope someone can help me with this :S
I am working on Android Studio 3.6.2 and Gradle version is 5.6.4.
I just tried to drag and drop a GridLayout into a ConstraintLayout. But for some reason the GridLayout shows completely grey.
I read in my research that could be something related with the Gradle files. I read I need:
1) implementation 'androidx.gridlayout:gridlayout:1.0.0'
2)
repositories {
google()
}
I have these two included in my Gradle files. So, am I missing something somewhere?
I upload a reference image and some code. Thanks in advance ;)
Design View
build.gradle (Project: AndroidSample)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.aretius.androidsample"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
}
build.gradle (Module: app)
buildscript {
ext.kotlin_version = '1.3.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Well, I finally solved my problem reinstalling Android Studio with the latest version of it :)

Instrumentation run failed due to 'java.lang.NoClassDefFoundError' after adding multidex to my application

This is the continuation of this question: Unable to merge dex - how to exclude proper jar?
I have not a typical android project, i am just working on the separate module, which is not connected with activies, fragments, UI etc. in my manifest i am not declaring any Android specifiacions. Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moduleName.sampleName"
>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION">
</uses-permission>
</manifest>
i was having the exception:
Caused by: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
So, here is what my build.gradle file looks like now:
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
packagingOptions {
exclude 'protobuf.meta'
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
sourceSets {
test.java.srcDirs += ['build/generated/source/apt/test/debug']
}
defaultConfig {
multiDexEnabled true
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
ext.daggerVersion = '2.11'
ext.roomVersion = '1.0.0-rc1'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testImplementation "org.robolectric:robolectric:3.4.2"
kaptTest "com.google.dagger:dagger-compiler:$daggerVersion"
kaptAndroidTest "com.google.dagger:dagger-compiler:$daggerVersion"
// RxJava
implementation 'io.reactivex.rxjava2:rxjava:2.1.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
// Room
implementation "android.arch.persistence.room:runtime:$roomVersion"
implementation "android.arch.persistence.room:rxjava2:$roomVersion"
kapt "android.arch.persistence.room:compiler:$roomVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.51"
androidTestImplementation "android.arch.persistence.room:testing:$roomVersion"
// Dagger
implementation "com.google.dagger:dagger:$daggerVersion"
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
implementation 'pl.charmas.android:android-reactive-location2:2.0#aar'
implementation 'com.google.android.gms:play-services-location:11.4.2'
implementation 'com.google.android.gms:play-services-places:11.4.2'
//Jackson
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.1'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.1'
implementation 'com.android.support:multidex:1.0.2'
}
My tests that are in the package 'test' are working fine.
But when i trying to run some test in my androidTest class package i get this:
Started running tests
Test running failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError'
Empty test suite.
To sum up:
The beginning of this problem is in the link above - i was having large amount of methods after adding jackson library, so i added dex support and this got me to this problem, which i really don't know how to solve - trying to exclude some depenendencies and leave only really important, trying to clean the project, deleting build package. None of them worked. If it is important i am using Kotlin in this module
You may have to add MultiDexApplication in the AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<application
android:name="com.example.myapp.MyApplication" >
...
</application>
If you do override the Application class, change it to extend MultiDexApplication (if possible) as follows:
public class MyApplication extends MultiDexApplication { ... }
Check this Google official blog here for MultiDex support

Error:(1, 0) Plugin with id 'kotlin-android-extensions' not found

apply plugin: 'kotlin-android-extensions'.
When i add this extensions in android studio preview, give me this error
"Error:(1, 0) Plugin with id 'kotlin-android-extensions' not found.".
My build gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.mohamed_elbaz.myapplication"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
The build.gradle snippet you posted looks like the config inside your app module. What does the build.gradle in your project's root directory look like? To add the kotlin plugin dependencies it should look something like this:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
The important part being the line classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"which adds the kotlin plugins.
To use the plugin, you have to add it in your root build.gradle file
buildscript {
ext.kotlin_version = '1.1.60'
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
In Android Studio we can fix it in following ways:_
Using the plugins Domain Specific Language (DSL) in App Level Graddle:
plugins {
id "org.jetbrains.kotlin.android.extensions" version "1.4.21"
}
That's all to fix it.
But if you're using legacy plugin application, then add the following in App Level Gradle:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21"
}
}
apply plugin: "org.jetbrains.kotlin.android.extensions"
Hopefully, it'll be helpful!
put the below lines in build.gradle app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
and also do changes in build gradle by adding kotlin extension and path
//put the ext above the dependency line//
ext.kotlin_version = '1.4.31'
dependencies {
classpath "com.android.tools.build:gradle:4.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

Icons look flat in action bar

I've recently "upgraded" my android project to SDK version 26, and now the icons in my app bar look like this (run on Android 6.0), although the icon itself looks like this. I've got no idea why this is happening, I didn't change anything in the java or xml code that seems to be related to this.
I would be very happy if someone posted a solution to this as this could be a bigger problem once Android 8 is released.
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "de.jamesbeans.quadrasolve"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "digit1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:percent:26.0.1'
}
relevant part of activity_main.xml:
<android.support.v7.widget.Toolbar
android:id="#+id/maintoolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/colorPrimaryDark"
android:theme="#style/Widget.AppCompat.ActionBar"
android:visibility="visible"
app:popupTheme="#style/Theme.AppCompat.Light"
app:title="QuadraSolve"
app:titleTextColor="#android:color/background_light" />
relevant part of MainActivity.java:
Toolbar maintoolbar = (Toolbar) findViewById(R.id.maintoolbar);
setSupportActionBar(maintoolbar);
...
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.mainmenu, menu);
return true;
}
mainmenu.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="#+id/action_history"
android:icon="#mipmap/ic_history_48px"
android:title="#string/history"
app:showAsAction="ifRoom">
</item>
</menu>
Had the same issue and stumbled across this answer which seems to have fixed the problem:
https://stackoverflow.com/a/45344964/4579919
The matter is that the icon size is bigger then the expected. Obviously the scaling mechanism has changed in SDK 26 and now it leads to this UI bug. Make sure the toolbar icon resources are provided in the following sizes.

Error:Failed to resolve: com.github.bumptech.glide:glide:4.0.0-SNAPSHOT

Build.gradle(Module:App)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.example.beetel.App"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
maven{ url "https://jitpack.io"}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
//glide libraries
compile 'com.android.support:palette-v7:23.3.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.github.florent37:glidepalette:2.0.0'
compile 'com.github.bumptech.glide:okhttp-integration:1.3.1#aar'
// { transitive = true;}
// { exclude group: 'com.squareup.okhttp';}
//compile 'com.google.code.gson:gson:2.6.1'
//retrofit,square,rxjava libraries
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'io.reactivex:rxjava:1.1.1'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.0-beta4'
//android support libraries
compile 'com.android.support:appcompat-v7:23.3.0'
// compile'com.android.support:appcompat-v4:23.2.0'
// compile 'net.steamcrafted:materialiconlib:1.0.9'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
// compile project(':AndroidBootstrap')
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.jd-alexander:LikeButton:0.1.8'
compile 'com.facebook.stetho:stetho-okhttp3:1.3.0'
compile 'com.facebook.stetho:stetho-okhttp:1.3.0'
}
Build.gradle (Project:App):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
// maven{
// url "https://oss.sonatype.org/content/repositories/snapshots"}
// maven
// {
// url "http://dl.bintray.com/florent37/maven"
//
// }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.beetel.App">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:largeHeap="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data android:name="com.example.beetel.App.utilities.ConfigGlide"
android:value="GlideModule"/>
<provider
android:authorities="com.example.beetel.App."
android:name="com.example.beetel.App.data.model.MoProvider"/>
<activity android:name="com.example.beetel.App.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.Main">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name="com.example.beetel.App.MoDActivity"
android:label="#string/title_activity_modetails"
android:parentActivityName="com.example.beetel.App.MainActivity"
android:theme="#style/AppTheme.Detail">
<meta-data android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.beetel.App.MainActivity"/>
</activity>
</application>
</manifest>
I am not able to understand why the error is coming again and again?
I want to implement glide palette to have more effective UI.
I tried to invalidate caches/restart,rebuild project,clean project etc.
Please help me...stuck with this not able to debug further.Deadlines approaching..
Thanks in advance!
Message after Gradle Build
In Build.gradle (Proyect app) add this
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
maven {
url "http://repo1.maven.org/maven2"
}
}
}
In Build.gradle (Module app) add the dependency com.github.bumptech.glide:glide:3.7.0
dependencies {
...
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
...
}
I too faced the same error. Add these lines to the repo and sync the project.
Worked for me like a charm.
repositories {
mavenCentral()
jcenter()
if (project.hasProperty('local.repo'))
{
maven { name 'glide-local'; url project.property('local.repo') }
}
maven { name 'glide-snapshot'; url 'http://oss.sonatype.org/content/repositories/snapshots' }
flatDir name: 'libs', dirs: 'libs'
maven
{
url "https://jitpack.io"
}
}
I had this issue and fixed it by putting these lines in build.gradle(Module: app)
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
and it fixed
I had this issue. If you have this error it's because you need to use jitpack.io to use -SNAPSHOT.
So u just have to copie this :
maven { url 'https://jitpack.io' }
in your file build.gradle(Module: app)
if you never touch this file it look like this :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}

Resources