gpt4 book ai didi

android - invokedynamic 需要 --min-sdk-version >= 26

转载 作者:IT王子 更新时间:2023-10-28 23:58:04 25 4
gpt4 key购买 nike

今天下载了studio 3.0 beta 2.0版本,之后尝试在里面打开一个已有的项目,遇到了一些困难,大部分问题我可以借助Google和Stack Overflow解决,但是这个我不行。

Error:Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: org.gradle.tooling.BuildException: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

同时发布我的应用程序 gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
applicationId "com.intersoft.snappy"
minSdkVersion 19
targetSdkVersion 22
multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypeMatching 'dev', 'debug'
buildTypeMatching 'qa', 'debug'
buildTypeMatching 'rc', 'release'
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/']
} }
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
}
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "https://jitpack.io" }
maven { url 'https://dl.bintray.com/ashokslsk/CheckableView' }
maven { url "https://maven.google.com" }

}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.0.1'
implementation 'com.github.mrengineer13:snackbar:1.2.0'
implementation 'com.android.support:recyclerview-v7:26.0.1'
implementation 'com.android.support:cardview-v7:26.0.1'
implementation 'com.android.support:design:26.0.1'
implementation 'com.android.support:percent:26.0.1'
implementation 'dev.dworks.libs:volleyplus:+'
implementation 'com.google.guava:guava:21.0'
implementation 'com.facebook.fresco:fresco:1.0.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.wdullaer:materialdatetimepicker:3.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.stfalcon:frescoimageviewer:0.4.0'
implementation 'com.github.piotrek1543:CustomSpinner:0.1'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.github.satyan:sugar:1.4'
implementation 'com.hedgehog.ratingbar:app:1.1.2'
implementation project(':sandriosCamera')
implementation('org.apache.httpcomponents:httpmime:4.2.6') {
exclude module: 'httpclient'
}
implementation 'com.googlecode.json-simple:json-simple:1.1'
}

afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = ['--multi-dex']
} else {
dx.additionalParameters += '--multi-dex'
}
}
}
subprojects {
project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
} else if
("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = false
}
}
}

buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
}
}

apply plugin: 'com.jakewharton.hugo'

也是我的另一个模块 gradle

apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'

buildscript {
repositories {
jcenter()
jcenter()
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}

group = 'com.sandrios.android'
version = '1.0.8'

ext {
PUBLISH_GROUP_ID = 'com.sandrios.android'
PUBLISH_ARTIFACT_ID = 'sandriosCamera'
PUBLISH_VERSION = '1.0.8'
PUBLISH_CODE = 9
}

android {
compileSdkVersion 26
buildToolsVersion "26.0.1"

defaultConfig {
minSdkVersion 19
targetSdkVersion 25
versionCode PUBLISH_CODE
versionName PUBLISH_VERSION
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}

task generateSourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier 'sources'
}

task generateJavadocs(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath()
.join(File.pathSeparator))
}

task generateJavadocsJar(type: Jar) {
from generateJavadocs.destinationDir
classifier 'javadoc'
}

generateJavadocsJar.dependsOn generateJavadocs

artifacts {
archives generateSourcesJar
archives generateJavadocsJar
}

install {
repositories.mavenInstaller {
pom.project {
name PUBLISH_GROUP_ID
description 'Simple integration of universal camera in android for easy image and video capture.'
url 'https://github.com/sandrios/sandriosCamera'
inceptionYear '2016'

packaging 'aar'
version PUBLISH_VERSION

scm {
connection 'https://github.com/sandrios/sandriosCamera.git'
url 'https://github.com/sandrios/sandriosCamera'

}
developers {
developer {
name 'arpitgandhi9'
}
}
}
}
}

bintray {
Properties properties = new Properties()

properties.load(project.rootProject.file('local.properties').newDataInputStream())
user = properties.getProperty('bintray.user')
key = properties.getProperty('bintray.apikey')
configurations = ['archives']
pkg {
repo = 'android'
name = 'sandriosCamera'
userOrg = 'sandriosstudios'
desc = 'Android solution to simplify work with different camera apis.'
licenses = ['MIT']
labels = ['android', 'camera', 'photo', 'video']
websiteUrl = 'https://github.com/sandrios/sandriosCamera'
issueTrackerUrl = 'https://github.com/sandrios/sandriosCamera/issues'
vcsUrl = 'https://github.com/sandrios/sandriosCamera.git'
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
desc = 'Minor fixes.'
released = new Date()
}
}
}

repositories {
jcenter()
}

dependencies {
implementation 'com.android.support:support-v4:26.0.0'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:recyclerview-v7:26.0.0'
implementation 'com.github.bumptech.glide:glide:3.6.1'
implementation 'com.yalantis:ucrop:2.2.0'
implementation 'gun0912.ted:tedpermission:1.0.2'
}

还有项目级别的gradle

// 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:3.0.0-beta2'

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

allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

请帮我摆脱这个错误

最佳答案

重要的部分:

您需要在该模块的 build.gradle 中添加它,而不是像 app 模块那样添加它。

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

另外你忘了为插件添加repo:

buildscript {
repositories {
jcenter()
google()
}
}

关于android - invokedynamic 需要 --min-sdk-version >= 26,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45862140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com