简体   繁体   English

我在使用 Gradle 时出错

[英]I have an error with Gradle

I have a problem, who can help me?我有问题,谁能帮帮我?

I made a application before 3 Months , with Android Studio 3. I tryed to open the application with Android Studio 2 but does't work .我在 3 个月前使用 Android Studio 3 制作了一个应用程序。我尝试使用 Android Studio 2 打开该应用程序,但没有成功。 So now I installed Android Stuido 3 but also It does't work :(所以现在我安装了 Android Stuido 3 但它也不起作用:(

This my Gradle :这是我的摇篮:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.1.1"
    defaultConfig {
        applicationId "com.learnjava.vgpro"
        minSdkVersion 14
        targetSdkVersion 26
        versionCode 4
        versionName "3"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

        implementation 'com.android.support:appcompat-v7:26.1.1'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.android.gms:play-services-ads:10.2.4'

}

This is the Problem :这就是问题 :

Error:(23, 0) Could not find method implementation() for arguments [directory 'libs'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
<a href="openFile:C:\Users\JamilHammash\Desktop\LearnJava\app\build.gradle">Open File</a>

update your gradle version to version 3, for example例如,将您的 gradle 版本更新到版本 3

   classpath 'com.android.tools.build:gradle:3.0.0-rc2'

otherwise replacing:否则替换:

testImplementation with testCompile 

an一个

implementation with compile  

should help应该有帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每次运行应用程序时都会出现 gradle 错误 - I have an gradle error everytime I run the app 我已经在gradle中添加了admob的Maven,但是为什么会出现此错误 - I have added maven for admob on the gradle but why this error comes 我的图像或 gradle 有错误,不知道是哪一个? - I have an error with image or gradle, don't know which one? 我有一些gradle问题...它显示了一些错误消息 - i have some gradle issues… it is showing some error message 我已升级到 gradle 7.2,现在我的项目遇到了错误 - I have upgraded to gradle 7.2, Now my project is caughting an error 错误:未找到Gradle DSL方法:“ implementation()”,但是我拥有所有Android Studio中的最新产品,gradle, - ERROR: Gradle DSL method not found: 'implementation()' But I have the newest of all Android Studio, gradle, 摇篮有一个错误,但它建立良好 - Gradle have an error but it build fine 尝试将 Firebase 添加到我的 android 项目时出现 gradle 同步错误 JAVA_LETTER_OR_DIGIT - I have a gradle sync error JAVA_LETTER_OR_DIGIT when trying to add Firebase to my android project 为什么在将gradle项目添加到另一个仓库后,即使建筑工作时,IDE中也存在语法错误? - Why I have syntax error in IDE after adding a gradle project to another repo even when the building works? 我正在使用android studio 2.1.2,并尝试获取最新的Facebook SDK,gradle似乎有错误 - I am using android studio 2.1.2 and am trying to get the latest facebook sdk, gradle seem to have an error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM