我面临以下错误:
Error:(89, 39) error: incomparable types: CAP#1 and int
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Error:Execution failed for task ':app:compileDebugJava'.
编译失败;有关详细信息,请参阅编译器错误输出。
我的Gradle文件如下所示:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0 rc3"
repositories {
maven { url "https://jitpack.io" }
mavenCentral()
jcenter()
}
defaultConfig {
applicationId "wishlist.oj.app"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:21.+'
compile 'com.android.support:cardview-v7:21.+'
}
错误来自我的回收器视图适配器文件,它只是将多堆文本视图膨胀为回收器视图
发布于 2015-12-28 13:56:38
错误:任务':app:compileDebugJava‘执行失败。
为了更好的实践
首先启用multiDexEnabled
,然后升级您的support:recyclerview
、support:appcompat
、support:cardview
版本
是Android SDK Build Tools 21.1及更高版本中提供的Android plugin for Gradle,它在构建配置中支持multidex。在尝试为您的应用程序配置multidex之前,请确保使用SDK管理器将Android SDK构建工具工具和Android支持存储库更新为最新版本。
要将应用程序开发项目设置为使用multidex配置,您需要对应用程序开发项目进行一些修改。特别是,您需要执行以下步骤:
修改您的应用程序Gradle构建文件配置,以包含支持库并启用多索引输出。
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 23
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1"
compile 'com.android.support:cardview-v7:23.1.1'
}
然后Clean-Rebuild-Restart-Sync你的项目
发布于 2015-12-28 13:56:29
变化
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1"
compile 'com.android.support:cardview-v7:23.1.1'
发布于 2020-05-14 18:24:49
只需添加。
android:{
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
https://stackoverflow.com/questions/34488349
复制相似问题