[英]Could not find method ImplementationSdkVersion() for arguments [26] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension
I would like someone to help me with this Android Studio error.我希望有人帮助我解决这个 Android Studio 错误。 I have bought an Android Application in internet, and I have also the android studio project files.
我在互联网上购买了一个 Android 应用程序,我还有 android studio 项目文件。 The thing is that this application has been made with an older version of Android studio I think, probably like 1 year and a half ago.
问题是,我认为这个应用程序是用旧版本的 Android Studio 制作的,大概是 1 年半以前。 I get this error Could not find method ImplementationSdkVersion() for arguments [26] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
我收到此错误无法为 com.android.build.gradle.internal.dsl.BaseAppModuleExtension 类型的对象上的参数 [26] 找到方法 ImplementationSdkVersion()。 after replacing all compile with implementation because those showed warnings and when I tried to get an APK from my android studio project that APK crashed on my Samsung.
在用实现替换所有编译之后,因为那些显示警告,当我试图从我的 android studio 项目中获取 APK 时,APK 在我的三星上崩溃了。 This is the gradle module app code: apply plugin: 'com.android.application'
这是 gradle 模块应用程序代码:apply plugin: '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'
Oh I finally found the solution.哦,我终于找到了解决方案。 I just changed the
我刚刚改变了
ImplementationSdkVersion 26
to到
compileSdkVersion 26
and it worked.它奏效了。 :) ^_^
:)^_^
那是因为你用实现替换了所有编译
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.