java - 在 com.android.build.gradle.internal.dsl.BaseAppModuleExtension 类型的对象上找不到参数 [26] 的方法 ImplementationSdkVersion()
问题描述
我希望有人帮助我解决这个 Android Studio 错误。我在互联网上购买了一个 Android 应用程序,并且我也有 android studio 项目文件。问题是这个应用程序是用旧版本的 Android Studio 制作的,我认为可能是一年半前。我收到此错误找不到 com.android.build.gradle.internal.dsl.BaseAppModuleExtension 类型对象的参数 [26] 的方法 ImplementationSdkVersion()。在用实现替换所有编译之后,因为那些显示警告并且当我试图从我的 android studio 项目中获取 APK 时,APK 在我的三星上崩溃了。这是 gradle 模块应用程序代码:应用插件:'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
ImplementationSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "codecanyon.carondeal"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
productFlavors {
}
}
repositories {
mavenCentral() // jcenter() works as well because it pulls from Maven Central
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
Implementation('org.apache.httpcomponents:httpmime:4.3') {
exclude module: "httpclient"
}
//implementation 'com.android.support:cardview-v7:26.0.0'
implementation 'com.android.support:appcompat-v7:26.0.0-alpha1'
implementation 'com.android.support:design:26.0.0-alpha1'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.android.support:cardview-v7:26.0.0-alpha1'
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.android.support:support-v4:26.0.0-alpha1'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
testimplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
解决方案
哦,我终于找到了解决方案。我只是改变了
ImplementationSdkVersion 26
至
compileSdkVersion 26
它奏效了。:) ^_^
推荐阅读
- laravel - Laravel 5.7 任务队列(Horizon)不接,尝试运行或失败任务
- php - PHP mkdir():docker 卷中的权限被拒绝
- r - 如何在数据集中整理我的 weekyear 变量
- ios - iOS 13 - 以错误的方向保存 UIImage
- java - 为什么 stream() 不能从刚刚声明的数组中工作
- c# - .NET 4 上的 ASP.NET MVC 应用程序在视图中找不到 ViewBag 和模型
- javascript - 文件数据在 textarea 中不可见,但可以使用 getElementsByClassName 在 console.log 中看到
- javascript - 如何从 js 或 jquery 中的 jsons 数组中的数组中提取特定值?
- typescript - 打字稿通用方法
- python - 如何在c中调用静态pyobject类型的c函数