I am doing the Android first app tutorial from http://developer.android.com/training/basics/firstapp/starting-activity.html.
I am trying to use FloatingActionButton but it is not recognised by Android Studio.
I have added this import:
import android.support.design.widget.FloatingActionButton;
But it is also not found.
Do I need to add any other dependencies?
If I add compile 'com.android.support:design:23.2.1' to the module's build.gradle I get:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:design:23.2.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.pom
https://jcenter.bintray.com/com/android/support/design/23.2.1/design-23.2.1.jar
file:/Users/octavian/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.2.1/design-23.2.1.pom
file:/Users/octavian/Library/Android/sdk/extras/android/m2repository/com/android/support/design/23.2.1/design-23.2.1.jar
file:/Users/octavian/Library/Android/sdk/extras/google/m2repository/com/android/support/design/23.2.1/design-23.2.1.pom
file:/Users/octavian/Library/Android/sdk/extras/google/m2repository/com/android/support/design/23.2.1/design-23.2.1.jar
Required by:
MyFirstApp:app:unspecified
add your gradle Support Design Library
compile 'com.android.support:design:23.2.1'
You can use one of them
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:design:23.1.1'
Version 23.2 buggy . See details Android Studio FloatingActionButton error
Add this:
dependencies {
compile 'com.android.support:appcompat-v7:23.+'
compile 'com.android.support:design:23.+'
}
Related
i am implementing Admob mediation in my application details are here
when i trying to add inmobi in cause the below error for adding compile 'com.google.ads.mediation:inmobi:6.2.0.0'in gradle dependencies
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.ads.mediation:inmobi:6.2.0.0.
Could not resolve com.google.ads.mediation:inmobi:6.2.0.0.
Required by:
project :app
> No cached version of com.google.ads.mediation:inmobi:6.2.0.0 available for offline mode.
gradle file look like below
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v13:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.google.android.gms:play-services-ads:11.4.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-gcm:11.4.2'
compile('com.vungle:publisher-sdk-android:5.3.0#aar') {
transitive=true
}
compile 'com.google.ads.mediation:vungle:5.3.0.0'
compile 'com.inmobi.monetization:inmobi-ads:6.2.0'
compile 'com.google.ads.mediation:inmobi:6.2.0.0'
}
there is also option for manual integration link for get the adapter file but there is no such adapter with same version
can any one explain how to resolve this.
Go to Preferences in Android Studio
Go to Gradle tab and uncheck "Offline work" if it is checked
Check if your PC has active internet connectivity
Sync your project again & you are good to go!
The min version of InMobi adapter is 6.2.3 : Link
Replace the gradle dependency to look something like this :
compile 'com.google.ads.mediation:inmobi:6.2.4.0'
PS: 6.2.4 is backward compatible with 6.2.0
Try updating the adapter and you can find the dependencies here
Also, try adding inmobi alone and take out vungle dependencies.
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'
Error:(27, 13) Failed to resolve: org.quanqi:android-view-pager-indicator:0.9.0
.....
Error:(29, 13) Failed to resolve: com.astuetz:pagerslidingtabstrip:1.0.1
....
Error:(28, 13) Failed to resolve: com.sothree.slidinguppanel:library:3.1.1
....
My gradle dependencies are
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'org.quanqi:android-view-pager-indicator:0.9.0'
compile 'com.sothree.slidinguppanel:library:3.1.1'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
my proxy is set in gradle.properties...(credentials not shown)
systemProp.http.proxyPassword=xxxxxx
systemProp.http.proxyHost=x.x.x.x
systemProp.http.proxyUser=xx#x.com
systemProp.http.proxyPort=8080
Still gradle build is failing... when I am building the project outside firewall its working perfect, no proxy required then. I am using Android Studio 1.4
I have already tried the following and was not successful:-
Using ViewPagerIndicator library with Android Studio and Gradle
Use HTTP as default in IntelliJ or Android Studio
I have already configured proxy settings for Andriod Studio and SDK.
This three r library projects and it is added as
in build.gradle import library module as
compile project(':library_projectname')
The add this line in settings.gradle
include ':app', ':library_projectname'
I have the followings in my dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.github.satyan:sugar:1.3.1'
compile 'com.android.support:support-v13:+'
}
and the project gets compiled very well, but when I add the following:
compile 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
I get this error message:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:support-v4:22.2.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
Required by:
MyApp:app:unspecified > com.android.support:appcompat-v7:22.1.1
MyApp:app:unspecified > com.android.support:support-v13:22.1.1
> Could not find com.android.support:support-v4:22.2.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.pom
file:/C:/Users/Navarch/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/22.2.1/support-v4-22.2.1.jar
Required by:
MyApp:app:unspecified > com.mohamadamin:persianmaterialdatetimepicker:1.2.1
I searched a lot but nothing seems to work for my case. How can I solve the issue?
If you have appcompat-v7:22.1.1, that means that you should have support-v4:22.1.1. The library you are trying to use is requesting support-v4:22.2.1, which is newer.
Make sure that your Android Repository is up to date in the SDK Manager. Usually, having older artifacts but not newer ones means that you have not updated the Android Repository recently.
one that says, Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:appcompat-v7:21.1.2.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar
file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar
file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.pom
file:/C:/Users/Richard/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.1.2/appcompat-v7-21.1.2.jar
Required by:
MyApplication:app:unspecified
And another one that says:
Error:(28, 13) Failed to resolve: com.android.support:appcompat-v7:21.1.2
Install Repository and sync project<br>Show in File<br>Show in Project Structure dialog
The Appcompat v 21.1.2 doesn't exist.
Check here the releases.
You can use:
You can use one of these:
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.android.support:appcompat-v7:21.0.0'