Android 3.3.0 更新,错误:原因:无效类型代码:68 [英] Android 3.3.0 update, ERROR: Cause: invalid type code: 68

查看:36
本文介绍了Android 3.3.0 更新,错误:原因:无效类型代码:68的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android Studio (3.3.0) 的新更新之后,我从 Gradle 同步收到错误消息,提示错误:原因:无效类型代码:68".即使在项目中,它也是在更新之前创建的并且根本没有改变.我试过重新安装 Android Studio,这也没有帮助,所以肯定有一些与我的项目不兼容的东西,但它没有说明是什么以及为什么.

After the new update of Android Studio (3.3.0) I'm getting error from Gradle sync saying "ERROR: Cause: invalid type code: 68". Even in project, that have been created before the update and hasn't changed at all. I've tried to reinstall Android Studio, which hasn't helped either, so there has to be something incompatible with my project, but it doesn't say what and why.

应用程序梯度:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "cz.cubeit.cubeit"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        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'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-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'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
}

项目梯度:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.11'
    ext.anko_version='0.10.7'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // 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
}

推荐答案

我遇到了同样的问题.我正在两台 PC 上开展一个项目:一台在我的办公室,一台在家里.在我的办公室,AS 3.3 更新后,一切正常,但在家里,按照我在办公室执行的相同步骤,出现错误代码 68.

I had the same problem. I was working on a project on two PCs: one at my office and one at home. In my office, after the AS 3.3 update, everything was fine but at home, after the same steps that I did at the office, the Error code 68 came out.

几个小时后,我想出了如何解决它.Android Studio 3.3 具有 "仅同步设置>实验中默认启用的活动变体"选项.禁用此功能解决了问题.但重新激活该功能会出现相同的错误,即使在成功同步 Gradle 之后也是如此.所以我认为这不是一个完整的解决方案,但至少现在我可以工作了.

After a couple of hours, I figured out how to solve it. Android Studio 3.3 has the " Only sync the active variant" option enabled by default in Settings>Experimental. Disabling this feature resolved the problem. But reactivating the feature the same error shows up, even after a successful Gradle sync. So I think this isn't a complete solution, but at least now I can work.

这篇关于Android 3.3.0 更新,错误:原因:无效类型代码:68的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆