久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

錯誤:未找到 Gradle DSL 方法:compile()

Error: Gradle DSL method not found: compile()(錯誤:未找到 Gradle DSL 方法:compile())
本文介紹了錯誤:未找到 Gradle DSL 方法:compile()的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

在此處輸入圖片描述

您好,我們已經為我們的網站創建了一個 android 應用,但現在您想將其轉換為 APK,但我遇到了以下錯誤,請不要讓我繼續編譯.

Hello, we've created an android app for our site, but now you want to turn it into an APK, but I've encountered the following error and do not let me move on with the compilation.

Error:(60, 0) Gradle DSL method not found: 'compile()'
    Possible causes:<ul><li>The project 'Template' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
    <a href="fixGradleElements">Upgrade plugin to version 2.3.3 and sync project</a></li><li>The project 'Template' may be using a version of Gradle that does not contain the method.
    <a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
    <a href="apply.gradle.plugin">Apply Gradle plugin</a></li>

這里是 build.gradle(項目:模板)

Here it's the build.gradle (Project: Template)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        maven {
            url 'https://jitpack.io'
        }
    }
}

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

ext {
    supportlib_version = '26.0.2'
    gps_version = '11.2.0'
}

//Ensure that all dependencies use the same version of the Android Support library
subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "$supportlib_version"
            }
            if (details.requested.group == 'com.google.android.gms'
                    && !details.requested.name.contains('multidex')) {
                details.useVersion "$gps_version"
            }
        }
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

第二個 build.gradle (Module:app)

and second build.gradle (Module:app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    defaultConfig {
        applicationId 'com.mayermayer.transport'
        minSdkVersion 16
        targetSdkVersion 26
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }

        //Optionally configure your OneSignal IDs below
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "",
                                onesignal_google_project_number: ""]
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    dexOptions {
        jumboMode true
    }
    productFlavors {
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
    maven {
        url "https://jitpack.io"
    }
    jcenter();
}

dependencies {
    compile 'com.devbrackets.android:exomedia:4.0.3'
    //TV
    compile 'com.cleveroad:audiovisualization:1.0.0'
    //Radio
    compile 'com.squareup.okhttp3:okhttp:3.3.1'
    //WC
    compile 'org.jsoup:jsoup:1.8.3'
    compile 'com.onesignal:OneSignal:[3.6.0,4.0.0)'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.booking:rtlviewpager:1.0.1'
    compile 'com.github.apg-mobile:android-round-textview:v0.0.3'
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
    compile 'com.google.code.gson:gson:2.8.0'
    //WC
    compile 'com.google.android.exoplayer:exoplayer:r2.4.3'
    //TV & Radio
    compile "com.android.support:cardview-v7:$supportlib_version" compile "com.android.support:appcompat-v7:$supportlib_version" compile "com.android.support:recyclerview-v7:$supportlib_version" compile "com.android.support:design:$supportlib_version" compile "com.android.support:support-v4:$supportlib_version" compile "com.android.support:support-core-utils:$supportlib_version" compile "com.android.support:support-media-compat:$supportlib_version" compile "com.google.android.gms:play-services-gcm:$gps_version" compile "com.google.android.gms:play-services-ads:$gps_version" compile "com.google.android.gms:play-services-maps:$gps_version" compile 'com.google.maps.android:android-maps-utils:0.5+'
    compile files('libs/YouTubeAndroidPlayerApi.jar')
}

我是不是哪里錯了?我使用的是 Android Studio 2.3.3 最新版本.

Am I wrong somewhere? I use Android Studio 2.3.3 latest version.

你能幫幫我嗎?你遇到過這個錯誤嗎?祝你有個美好的一天.

Can you please help me? Have you met this error? I wish you a beautiful day.

推薦答案

將此行移到不同的行:

    //TV & Radio
   compile "com.android.support:cardview-v7:$supportlib_version" compile "com.android.support:appcompat-v7:$supportlib_version" compile "com.android.support:recyclerview-v7:$supportlib_version" compile "com.android.support:design:$supportlib_version" compile "com.android.support:support-v4:$supportlib_version" compile "com.android.support:support-core-utils:$supportlib_version" compile "com.android.support:support-media-compat:$supportlib_version" compile "com.google.android.gms:play-services-gcm:$gps_version" compile "com.google.android.gms:play-services-ads:$gps_version" compile "com.google.android.gms:play-services-maps:$gps_version" compile 'com.google.maps.android:android-maps-utils:0.5+'

你不能以這種方式使用compile.使用這個:

You can't use compile in this way. Use this:

compile "com.android.support:cardview-v7:$supportlib_version" 
compile "com.android.support:appcompat-v7:$supportlib_version" 
compile "com.android.support:recyclerview-v7:$supportlib_version" 
compile "com.android.support:design:$supportlib_version" 
compile "com.android.support:support-v4:$supportlib_version" 
compile "com.android.support:support-core-utils:$supportlib_version" 
compile "com.android.support:support-media-compat:$supportlib_version" 
compile "com.google.android.gms:play-services-gcm:$gps_version" 
compile "com.google.android.gms:play-services-ads:$gps_version" 
compile "com.google.android.gms:play-services-maps:$gps_version" 
compile 'com.google.maps.android:android-maps-utils:0.5+'

這篇關于錯誤:未找到 Gradle DSL 方法:compile()的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

IncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出現 IncompatibleClassChangeError)
How to get current flavor in gradle(如何在 gradle 中獲取當前風味)
How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修復“意外元素lt;查詢gt;在“清單中找到錯誤?)
Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多風味庫的多風味應用)
Android dependency has different version for the compile and runtime(Android 依賴在編譯和運行時有不同的版本)
Transitive dependencies for local aar library(本地 aar 庫的傳遞依賴)
主站蜘蛛池模板: 国产精品无码久久久久 | 天堂在线一区 | 国产精品一区在线 | 久热免费| 欧美一区二区三区大片 | 97久久国产| 日韩一区二区三区精品 | 欧美日韩国产一区二区三区 | 亚洲国产成人在线观看 | 久草视频网站 | 欧美xxxx做受欧美 | 日日操av | 精品一区二区三区在线播放 | 中文在线a在线 | 黄色大片免费网站 | 91精品中文字幕一区二区三区 | 日韩精品一区二区三区在线播放 | 成人精品一区二区三区四区 | 围产精品久久久久久久 | 在线免费观看色 | 国产成人精品一区二区三区四区 | 国产精品日日摸夜夜添夜夜av | 99久久婷婷 | 性色av一区二区三区 | 亚洲精品国产综合区久久久久久久 | 午夜在线影院 | 久久久久久亚洲精品 | 欧美一级淫片免费视频黄 | 国产乱码久久久久久一区二区 | 91玖玖| a在线视频观看 | 国产精品一区二区三区久久久 | 欧美一级免费看 | 真人毛片| 丁香六月伊人 | 黄色高清视频 | 国产成人亚洲精品 | avtt国产| 97超碰在线播放 | 91精品国产乱码久久久久久久久 | 亚洲综合在 |