【问题标题】:Android studio 3.3.1 gradle 4.10.1 make project BUILD FAILEDAndroid studio 3.3.1 gradle 4.10.1 使项目构建失败
【发布时间】:2019-07-02 06:35:10
【问题描述】:

我创建了一个新项目并制作了“Make Project”但失败了。

Executing tasks: [:app:assembleDebug]

Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript
Task :app:checkDebugManifest
Task :app:generateDebugBuildConfig
Task :app:prepareLintJar
Task :app:generateDebugSources
Task :app:javaPreCompileDebug
Task :app:mainApkListPersistenceDebug
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:mergeDebugResources
Task :app:createDebugCompatibleScreenManifests
Task :app:processDebugManifest
Task :app:processDebugResources
Task :app:compileDebugJavaWithJavac
Task :app:compileDebugNdk NO-SOURCE
Task :app:compileDebugSources
Task :app:mergeDebugShaders
Task :app:compileDebugShaders
Task :app:generateDebugAssets
Task :app:mergeDebugAssets
Task :app:mergeExtDexDebug
Task :app:mergeLibDexDebug
Task :app:transformClassesWithDexBuilderForDebug
Task :app:mergeProjectDexDebug
Task :app:validateSigningDebug
Task :app:signingConfigWriterDebug
Task :app:mergeDebugJniLibFolders
Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ‘:app:transformNativeLibsWithMergeJniLibsForDebug’.
Internal error when trying to read zip file ‘C:\Users\james52.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\67ba81e89842cc3e1a0ff84b0e9b8d8f\jars\classes.jar’.

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

通过https://help.gradle.org获得更多帮助

在 14 秒内构建失败 24 个可操作的任务:24 个已执行”

格兰德

buildscript {
repositories {
google()
jcenter()

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId “com.example.myapplication”
minSdkVersion 28
targetSdkVersion 28
versionCode 1
versionName “1.0”
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android-optimize.txt’), ‘proguard-rules.pro’
}
}
}

dependencies {
implementation fileTree(dir: ‘libs’, include: [’*.jar’])
implementation ‘com.android.support:appcompat-v7:28.0.0’
implementation ‘com.android.support.constraint:constraint-layout:1.1.3’
testImplementation ‘junit:junit:4.12’
androidTestImplementation ‘com.android.support.test:runner:1.0.2’
androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’
}

【问题讨论】:

  • 所有这些有趣的 都是语法错误......这种情况发生的可能性很小。
  • 我也遇到了同样的问题,你找到解决办法了吗??

标签: java android android-studio gradle


【解决方案1】:

将 PROJECT LEVEL 的 build:gradle 版本更改为 android studio 版本

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-19
    • 2013-08-17
    • 1970-01-01
    • 2020-10-16
    • 2013-06-13
    • 2015-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多