尝试添加
时遇到此错误compile "com.android.support:support-core-utils:23.2.1"
为我的移动应用构建build.gradle。这是整个build.gradle(移动) 申请插件:' com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.xxxxxxx.sam.collegegrader"
minSdkVersion 10
targetSdkVersion 23
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(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
wearApp project(':wear')
compile 'com.google.android.gms:play-services:9.8.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
compile 'com.android.support:support-core-utils:23.2.1'
}
这是我的第一个Android应用程序,所以,我可能刚刚犯了一个初学者错误。以下是我采取的解决问题的步骤:
Failed to resolve: com.android.support:appcompat-v7:15.+ - 按照教程添加库
https://developer.android.com/studio/intro/update.html#sdk-manager - 添加了编译到build.gradle(移动)
https://developer.android.com/topic/libraries/support-library/setup.html#using-apis - 我相信我在build.gradle中有正确的版本#(23.2.1)
这是我尝试使用android:theme =" @ style / ThemeOverlay.AppCompat.Dark.Actionbar" RES /布局/ activity_view_college.xml failed to resolve com.android.support:appcompat-v7:22 and com.android.support:recyclerview-v7:21.1.2
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.xxxxxx.sam.collegegrader.ViewCollegeActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/ThemeOverlay.AppCompat.Dark.Actionbar"
android:fitsSystemWindows="true" >
</android.support.design.widget.AppBarLayout>
<!--<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/large_text" />-->
</android.support.design.widget.CoordinatorLayout>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
styles.xml(v21)
<resources>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
答案 0 :(得分:1)
您收到此错误是因为support-core-utils
库是v23.2.1
中v4支持库的一部分。
随着v24.2.0
的发布,v4支持库被拆分为几个较小的模块,其中一个是support-core-utils
。有关拆分的更多信息,请查看以下链接:https://developer.android.com/topic/libraries/support-library/revisions.html#24-2-0-v4-refactor
因此,您的问题的解决方案是使用较新版本的support-core-utils
库,例如25.0.1
。