Failed to resolve: com.facebook.fresco:fresco:0.8.1+ - android

I have a problem adding the fresco dependency in my project.
Here some screenshots of problem

You have to change
compile 'com.facebook.fresco:fresco:0.8.1+'
with
compile 'com.facebook.fresco:fresco:0.8.1'
The version 0.8.1+ doens't exist.
I suggest you avoiding the use of the + but if you want to use it, you can use one of these:
compile 'com.facebook.fresco:fresco:0.8.1'
compile 'com.facebook.fresco:fresco:0.8.+'
compile 'com.facebook.fresco:fresco:0.+'
compile 'com.facebook.fresco:fresco:+'

Related

Gradle file is edited on creating new Activity/Fragment

On creating a new Activity by
right-click on app > New > Activity > Empty Activity
Activity is created, but gradle file is auto-edited giving the error:
Error: Could not get unknown property 'compile' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
It happens same with Fragments. I'm using Android Studio 2.3.
How do I resolve this?
Code Sample:
// retrofit dependency
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
// charts
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
After creating Activity
compile
'com.google.code.gson:gson:2.7'compile
'com.squareup.retrofit2:retrofit:2.1.0'compile
'com.squareup.retrofit2:converter-gson:2.1.0'compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
The solution, for now, is to remove the comments inside the dependencies.
This question is asked a few times before. Here is the most recent one.
This is a bug possibly related to Java JDK and there is no possible solution, temporary solution is re-format your Gradle like this:
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'

Android Studio Can't Fetch Library

I have recently started getting this issue with Android Studio and it has been driving me up the wall. I keep getting the error "Failed to resolve: com.squareup.okio:okio:1.8.0". These are the dependencies I have:
dependencies {
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile files('libs/okio-1.8.0.jar')
compile files('libs/retrofit-2.1.0 (1).jar')
}
As you can see, I have the retrofit and gson libraries simply compile (I'm assuming this downloads them from the internet), I tried doing the same with Okio however it didn't resolve, so I have speicifcally downloaded the 1.8.0 Okio JAR however it still fails to resolve. Why could this be? Any answer would be greatly appreciated. Thank you
Don't put dependencies as a Gradle dependency:
compile 'com.squareup.retrofit2:retrofit:2.1.0'
And as a .jar file in src/libs:
compile files('libs/retrofit-2.1.0 (1).jar')
at one time. Choose only one method. I advise you to choose Gradle dependencies, because they are automatically fetched.
In you case, the dependencies section should look like:
dependencies {
compile `com.google.code.gson:gson:2.7`
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
}

Attribute "background" already defined with incompatible format in Android Studio

I imported my project from Eclipse to Android Studio. As it is merging all the files, I am getting error : Attribute "background" already defined with incompatible format.Check my below libraries :
compile project(':staggeredGrid')
compile project(':mobikwikSDK')
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
I am new to Android Studio so I don't have any idea about how can I solved this. I tried to change that attribute name but there are many same names so I am unable to go ahead.Please help me to solve this.
ActionBarSherlock is deprecated so migrate to AppCompat
Remove
compile 'com.actionbarsherlock:actionbarsherlock:4.4.0#aar'
Add
compile 'com.android.support:appcompat-v7:24.1.1'

Android Studio Weird Warning

After I updated my Support library from 23.1.1 to 23.4.0 I get this warning cannot access android.support.v4.app.baseFragmentActivityEclair on every call to super and every instance of AppCompatActivity
And if I updated my support library to 24.1.1 The warning changes to cannot access android.support.v4.app.baseFragmentActivityJB.
Can anyone tell me why this warning is shown and how can I remove this warning:
here is my dependencies before:
(no error in this)
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:gridlayout-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
here is my dependencies after cannot access android.support.v4.app.baseFragmentActivityEclairwarning:
compile 'com.android.support:palette-v7:23.4.0'
compile 'com.android.support:gridlayout-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
here is my dependencies after cannot access android.support.v4.app.baseFragmentActivityJBwarning:
compile 'com.android.support:palette-v7:24.1.1'
compile 'com.android.support:gridlayout-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
We ran into a similar problem when one of the packages in our project had dependencies on version 24.0 support libraries and another package was dependent on version 23.4.0. This seems to be a problem for the Android Studio (IntelliJ) IDE, not the compiler, because we were able to build and run the project without any problems. We resolved the warning by reverting the 24.0 dependency to 23.4.0. I suspect that going the other direction (advancing all of our package dependencies to 24.0) would also have eliminated the warning but we didn't experiment with that due to the number of packages in our project.
If you're looking to hack around this, many of the support libraries have an internal library called libs/internal_impl-$VERSION.jar that includes these types of version-specific implementations. To get your IDE to work, you can extract these JARs and manually include them in your IDE's build path.
For example, you can extract the classes referenced here, assuming version 24.2.1, using this command:
unzip support-fragment-24.2.1.aar libs/internal_impl-24.2.1.jar

I have trouble configure android studio header file

I have the driver install, but i do not see what the problem is.
Problem is in your gradle file
make sure you added this dependencies
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
compile 'com.google.android.gms:play-services-maps:8.1.0'

Categories

Resources