当前位置: 首页 > 知识库问答 >
问题:

android studio-Gradle的问题

罗鸿福
2023-03-14

我做了一个android应用程序的代码维护,其他人在android Studio中写的。

当我尝试将project与Gradle文件同步时,我会收到以下错误消息:

23:46:27 UnsupportedMethodException
     Failed to set up Android modules in project 'BuyTheWay': Unsupported method: SourceProvider.getJniDirectories().
     The version of Gradle you connect to does not support that method.
     To resolve the problem you can change/upgrade the target version of Gradle you connect to.
     Alternatively, you can ignore this exception and read other information from the model.
runProguard false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
cannot resolve symbol getDefaultProguardFile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.14.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
classpath 'com.android.tools.build:gradle:0.14.0'  
 classpath 'com.android.tools.build:gradle:0.14.+' 

并尝试将project与Gradle文件同步,我得到以下错误消息:

    Error:(17, 0) Gradle DSL method not found: 'runProguard()'
Possible causes:
     The project 'BuyTheWay' may be using a version of Gradle that does not contain the method.
    <a href="open.wrapper.file">Open Gradle wrapper file</a>
    The build file may be missing a Gradle plugin.
    <a href="apply.gradle.plugin">Apply Gradle plugin</a>

共有1个答案

岳承悦
2023-03-14

一步就能解决这个问题。

buildTypes {
  release {
    apply plugin: 'eclipse'
    runProguard false // <==== **remove this line**
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  }
}
 类似资料:
  • 前面我们讲了 Gradle 在 Android 项目中的配置,我们提到有一个闭包 signingConfigs 是配置 Android 应用签名信息的。那么今天我们就来讲讲如何通过 AndroidStudio 对 APK 进行签名。 1. 新建 keyStore 文件 我们下面一步步带大家,用 AndroidStudio 来配置签名。 首先顶部菜单栏找到 Build 点击他我们会看到 Genera

  • 驴你看,我要添加截取到我的应用程序添加这行代码com.mcxioke。截取:库aar:1.0.0建立。gradle文件 我也试着添加改装。但它给出了相同类型的错误:未能解决:bla bla bla。 所以我认为在我的情况下gradle不能同步任何其他库不同于com.android....... 我也尝试将这行代码添加到我的build.gradle。但是什么都没有改变 请指教 编辑:添加注释后生成。

  • 应用程序 SlidingMenu(源文件) SlidingMenu-Maps-Support(源文件) 这里有一个链接,看看我的意思。 这就是我得到的错误。 谢谢! 编辑1:不要紧!我又回到月食了!Android Studio还没有为真正的项目开发做好准备。

  • 我有32位Ubuntu14.04LTS我从android开发者网站安装了android Studio2.1.3当我试图运行一个项目时,gradle花了很多时间来构建它显示错误为 /home/user/android/sdk/build-tools/24.0.1/aapt:2:/home/usr/android/sdk/build-tools/24.0.1/aapt:语法错误:未终止的引号字符串 j

  • 我正在做从 Gradle 1.6 迁移到 2.1 的 POC 工作(基本上是为了解决这个问题:Gradle 构建/测试失败 - kryo。Kryo例外:缓冲区溢出)。 Gradle构建在Gradle 1.6上成功运行 在Gradle 2.1中,当我运行“Gradle clean build”时,会收到以下错误消息。 和 全局级别init.d/extra1...常见的gradle文件行是:我使用了相

  • 我安装了Android Studio 3.4,在同步gradle时遇到了这个问题。我到处都找不到解决问题的办法。 以下是我收到的错误: “无法解析:com.android。支持:appcompat-v7:28.0.0在项目结构对话框中显示受影响的模块:app” “无法解析:com.android.support。约束:约束布局:1.1.3在项目结构对话框中显示受影响的模块:应用程序” “无法解析: