简体   繁体   English

无法在 com.android.build.gradle.internal.dsl.BaseAppModuleExtension 类型的对象上找到参数 [26] 的方法 ImplementationSdkVersion()

[英]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.

相关问题 在 org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler 类型的存储库容器上找不到 arguments [] 的方法 jCenter() - Could not find method jCenter() for arguments [] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler 找不到 arguments [com.android.tools.build:gradle] 的方法 classpath() - Could not find method classpath() for arguments [com.android.tools.build:gradle] Gradle 构建:找不到参数的方法签名配置() - Gradle build: Could not find method signingConfig() for arguments 在 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的对象上找不到参数 [directory 'libs'] 的 compile() - Couldn't find compile() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava / util / List - Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List Gradle - 错误找不到 arguments 的方法 implementation() [com.android.support:appcompat-v7:26.0.0] - Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0] build.gradle - 找不到参数的方法 copyDeps() - build.gradle - Could not find method copyDeps() for arguments 无法为 org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 类型的 object 获取未知属性“实现” - Could not get unknown property 'implementation' for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler 无法获取类型为com.android.build.gradle.internal.api.DefaultAndroidSourceSet的源集主体的未知属性“输出” - Could not get unknown property 'output' for source set main of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet 无法为类型com.android.build.gradle.internal.api.DefaultAndroidSourceSet的源集主设置未知属性's' - Could not set unknown property 's' for source set main of type com.android.build.gradle.internal.api.DefaultAndroidSourceSet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM