【发布时间】:2018-11-13 06:14:39
【问题描述】:
这是我的 gradle 文件
在 oreo 中我没有得到正确的输出。
这是我在奥利奥中得到的输出。
我尝试升级 compileSdkVersion,但得到一个错误,所有库必须使用相同的版本。 请告诉我如何解决这个问题。
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.rayvatapps.inspiquo"
minSdkVersion 21
targetSdkVersion 22
versionCode 12
versionName "3.4"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:22.2.0'
implementation 'com.android.support:appcompat-v7:22.2.0'
implementation 'com.android.support:support-v4:22.2.0'
//cardview
implementation 'com.android.support:cardview-v7:22.2.0'
//recyclerview
implementation 'com.android.support:recyclerview-v7:22.2.0'
//glide
implementation 'com.github.bumptech.glide:glide:3.6.0'
implementation 'de.hdodenhof:circleimageview:1.3.0'
//voley
implementation 'com.android.volley:volley:1.0.0'
//gson
implementation 'com.google.code.gson:gson:2.6.2'
//sdp
implementation 'com.intuit.sdp:sdp-android:1.0.5'
//ripple effect
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
//jsoup
compile 'org.jsoup:jsoup:1.11.1'
}
xml
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:fitsSystemWindows="true">
<include layout="@layout/include_list_viewpager"/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header"
app:menu="@menu/drawer_view"/>
</android.support.v4.widget.DrawerLayout>
任何帮助将不胜感激。
【问题讨论】:
-
项目从某处获得颜色,请仔细检查代码是否您声明粉红色更改它并再次运行。也许检查你的 res > values > colors > colorAccent
-
它在所有其他 androids 操作系统中都可以正常工作
-
更新 compileSdkVersion 并将以下代码放入项目 gradle subprojects {configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support ') { if (!requested.name.startsWith("multidex")) { details.useVersion '27.1.1' } } } } }
-
这不是编译问题,这只是您的编码显示 java 文件中的错误
-
你的问题在这里解决了:stackoverflow.com/questions/42700908/…
标签: android navigation-drawer android-8.0-oreo