pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

錯誤:未找到 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 庫的傳遞依賴)
主站蜘蛛池模板: C形臂_动态平板DR_动态平板胃肠机生产厂家制造商-普爱医疗 | 膜结构_ETFE膜结构_膜结构厂家_膜结构设计-深圳市烨兴智能空间技术有限公司 | 西安微信朋友圈广告投放_微信朋友圈推广_西安度娘网络科技有限公司 | 电动球阀_不锈钢电动球阀_电动三通球阀_电动调节球阀_上海湖泉阀门有限公司 | 517瓜水果特产网|一个专注特产好物的网站 | 逗网红-抖音网红-快手网红-各大平台网红物品导航 | 软瓷_柔性面砖_软瓷砖_柔性石材_MCM软瓷厂家_湖北博悦佳软瓷 | 工业车间焊接-整体|集中除尘设备-激光|等离子切割机配套除尘-粉尘烟尘净化治理厂家-山东美蓝环保科技有限公司 | 注塑模具_塑料模具_塑胶模具_范仕达【官网】_东莞模具设计与制造加工厂家 | 棉柔巾代加工_洗脸巾oem_一次性毛巾_浴巾生产厂家-杭州禾壹卫品科技有限公司 | 光伏支架成型设备-光伏钢边框设备-光伏设备厂家 | Eiafans.com_环评爱好者 环评网|环评论坛|环评报告公示网|竣工环保验收公示网|环保验收报告公示网|环保自主验收公示|环评公示网|环保公示网|注册环评工程师|环境影响评价|环评师|规划环评|环评报告|环评考试网|环评论坛 - Powered by Discuz! | 西点培训学校_法式西点培训班_西点师培训_西点蛋糕培训-广州烘趣西点烘焙培训学院 | 陶瓷加热器,履带式加热器-吴江市兴达电热设备厂 | SEO网站优化,关键词排名优化,苏州网站推广-江苏森歌网络 | 电位器_轻触开关_USB连接器_广东精密龙电子科技有限公司 | 沥青灌缝机_路面灌缝机_道路灌缝机_沥青灌缝机厂家_济宁萨奥机械有限公司 | 首页|专注深圳注册公司,代理记账报税,注册商标代理,工商变更,企业400电话等企业一站式服务-慧用心 | 空压机网_《压缩机》杂志| 西子馋火锅鸡加盟-太原市龙城酉鼎餐饮管理有限公司 | 干粉砂浆设备-干粉砂浆生产线-干混-石膏-保温砂浆设备生产线-腻子粉设备厂家-国恒机械 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 二手回收公司_销毁处理公司_设备回收公司-找回收信息网 | 不锈钢管件(不锈钢弯头,不锈钢三通,不锈钢大小头),不锈钢法兰「厂家」-浙江志通管阀 | 北京中创汇安科贸有限公司 | 首页-瓜尔胶系列-化工单体系列-油田压裂助剂-瓜尔胶厂家-山东广浦生物科技有限公司 | 精密五金加工厂-CNC数控车床加工_冲压件|蜗杆|螺杆加工「新锦泰」 | 恒压供水控制柜|无负压|一体化泵站控制柜|PLC远程调试|MCGS触摸屏|自动控制方案-联致自控设备 | 液压中心架,数控中心架,自定心中心架-烟台恒阳机电设计有限公司 行星搅拌机,双行星搅拌机,动力混合机,无锡米克斯行星搅拌机生产厂家 | 济南保安公司加盟挂靠-亮剑国际安保服务集团总部-山东保安公司|济南保安培训学校 | 辐射仪|辐射检测仪|辐射巡测仪|个人剂量报警仪|表面污染检测仪|辐射报警仪|辐射防护网 | 质检报告_CE认证_FCC认证_SRRC认证_PSE认证_第三方检测机构-深圳市环测威检测技术有限公司 | 氧化锆陶瓷_氧化锆陶瓷加工_氧化锆陶瓷生产厂家-康柏工业陶瓷有限公司 | 私人别墅家庭影院系统_家庭影院音响_家庭影院装修设计公司-邦牛影音 | 筛分机|振动筛分机|气流筛分机|筛分机厂家-新乡市大汉振动机械有限公司 | EFM 022静电场测试仪-套帽式风量计-静电平板监测器-上海民仪电子有限公司 | 出国劳务公司_正规派遣公司[严海] | 换网器_自动换网器_液压换网器--郑州海科熔体泵有限公司 | 对辊式破碎机-对辊制砂机-双辊-双齿辊破碎机-巩义市裕顺机械制造有限公司 | 山东艾德实业有限公司 | 机构创新组合设计实验台_液压实验台_气动实训台-戴育教仪厂 |