Since I updated Android Studio to 2.3 I'm having problems that don't influence when using the application on my mobile, but if it shows me errors from Android Studio and I don't know if I'll have problems in the future, that's why I want to solve them.
The first is in the gradle
and is as follows:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.1.0, 25.0.2. Examples include com.android.support:animated-vector-drawable:25.1.0 and com.android.support:renderscript:25.0.2
This is my gradle
, compile 'com.android.support:appcompat-v7:25.1.0'
where I get the above message.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "otrointento.dos"
minSdkVersion 19
targetSdkVersion 25
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile files('libs/circleimageview/gradle/wrapper/gradle-wrapper.jar')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.github.clans:fab:1.6.2'
compile 'com.android.support:design:25.1.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'fr.tvbarthel.blurdialogfragment:lib:2.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
}
And the other problem is in thisxml
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/base_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#f4f4f4">
<ListView
android:id="@+id/listViewPersonas"
android:layout_width="match_parent"
android:divider="#f4f4f4"
android:dividerHeight="7dp"
android:layout_height="match_parent" />
<com.github.clans.fab.FloatingActionMenu
android:id="@+id/icon_btn_flo_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="11dp"
android:layout_marginLeft="11dp"
android:layout_marginRight="11dp"
fab:menu_animationDelayPerItem="55"
fab:menu_backgroundColor="@android:color/transparent"
fab:menu_buttonSpacing="0dp"
fab:menu_colorNormal="#46b1bb"
fab:menu_colorPressed="#3d979f"
fab:menu_colorRipple="#99d4d4d4"
fab:menu_fab_size="normal"
fab:menu_icon="@drawable/fab_add"
fab:menu_labels_colorNormal="#46b1bb"
fab:menu_labels_colorPressed="#3d979f"
fab:menu_labels_colorRipple="#66efecec"
fab:menu_labels_cornerRadius="3dp"
fab:menu_labels_ellipsize="none"
fab:menu_labels_hideAnimation="@anim/fab_slide_out_to_right"
fab:menu_labels_margin="0dp"
fab:menu_labels_maxLines="-1"
fab:menu_labels_padding="8dp"
fab:menu_labels_position="left"
fab:menu_labels_showAnimation="@anim/fab_slide_in_from_right"
fab:menu_labels_showShadow="true"
fab:menu_labels_singleLine="false"
fab:menu_labels_textColor="#f2f1f1"
fab:menu_labels_textSize="15sp"
fab:menu_openDirection="up"
fab:menu_shadowColor="#45baba"
fab:menu_shadowRadius="4dp"
fab:menu_shadowXOffset="1dp"
fab:menu_shadowYOffset="4dp"
fab:menu_showShadow="true">
<com.github.clans.fab.FloatingActionButton
android:id="@+id/icon_btn_flo_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_btn_flo_1"
fab:fab_label="@string/btn_flo_1"
fab:fab_size="mini"
android:clickable="false" />
</com.github.clans.fab.FloatingActionMenu>
</AbsoluteLayout>
Failed to instantiate one or more classes
The following classes could not be instantiated:
The error message indicates the problem:
you can keep
and change the versions of the design and compatibility libraries to the same version, if it exists, apparently not all versions are listed in the official documentation: https://developer.android.com/topic/libraries/support- library/revisions.html :
but as of today the latest version is 25.2.0 :
Make sure you have installed the version indicated in your
Build.gradle
and this version must have your library. Make sure thebuildToolsVersion
defined one is an existing one :As for the dependency message
com.android.support:renderscript
:It's a detail reported to Google: https://code.google.com/p/android/issues/detail?id=236471
so you can choose to use:
When upgrading from one Android Studio version to a newer version it is advisable to invalidate cache:
Update Android Studio 2.3 and get error Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?
Set the version of the library to the same as it is in
buildToolsVersion
or vice versa.You can leave the support library like this:
or leave
buildToolsVersion
it like thatThe idea is that they use the same version.
Regarding this:
The same thing happened to me with another example
and I had to add the
compile''
specific line, that is, it showed me an error with this:Then I have added the specific library that it indicated (
com.android.support:customtabs:25.2.0
):I guess it used to be inside another bookstore and now they've separated it.
Regarding the xml error, it may be related to the gradle error due to the libraries and it can be solved in the same way, although I would say that the error is that the library you use has some incompatibility with other updated libraries.
These objects I guess: