我已经在项目中将buildToolsVersion更新为'26.0.2',现在我在尝试构建发布版apk时遇到了这样的错误。有什么解决办法吗?
com.android.ide.common.prrocess.ProcessException:执行时出错process/Users/Iryna/Library/Android/sdk/build-tools/26.0.2/aptarguments{package-f-no crunch-I/用户/Iryna/Library/Android/sdk/platforms/Android-25/Android.jar-M/用户/Iryna/Documents/Projects/xxx/mobile/android/app/build/inmediates/manifest/full/release/AndroidManifest.xml-S/Users/Iryna/Documents/Projects/xxx/mobile/android/app/build/intermediates/res/merged/release-m-J
我试着回到旧版本(25.0.0)的构建工具,但如果我减少它,我会得到渐变错误:
找不到参数的方法implementation()类型的对象上的[com.google.firebase:firebase-core:111.6.0]org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler。打开文件
build.gradle应用
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.cityfalcon"
minSdkVersion 17
targetSdkVersion 23
versionCode 10
versionName "1.8"
multiDexEnabled true
vectorDrawables.useSupportLibrary true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
debug {
storeFile file(XXX_RELEASE_STORE_FILE)
storePassword XXX_RELEASE_STORE_PASSWORD
keyAlias XXX_RELEASE_KEY_ALIAS
keyPassword XXX_RELEASE_KEY_PASSWORD
}
release {
storeFile file(XXX_RELEASE_STORE_FILE)
storePassword XXX_RELEASE_STORE_PASSWORD
keyAlias XXX_RELEASE_KEY_ALIAS
keyPassword XXX_RELEASE_KEY_PASSWORD
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable false
}
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a": 1, "x86": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.firebase:firebase-crash:11.6.0'
compile project(':react-native-linkedin-login')
compile project(':react-native-twitter-signin')
compile project(':react-native-google-signin')
compile project(':react-native-fbsdk')
compile project(':react-native-spinkit')
compile project(':react-native-linear-gradient')
compile('com.twitter.sdk.android:twitter:2.3.2@aar') {
transitive = true;
}
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.facebook.react:react-native:0.39.2'
// From node_modules
compile 'com.instabug.library:instabug:4.0.8'
compile(project(':react-native-google-signin')) {
exclude group: "com.google.android.gms" // very important
}
compile 'org.piwik.sdk:piwik-sdk:1.0.2'
compile 'com.google.android.gms:play-services:11.6.0'
compile 'com.newrelic.agent.android:android-agent:5.12.0'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
// Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
build.gradle项目:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'io.fabric.tools:gradle:1.22.2'
classpath "com.newrelic.agent.android:agent-gradle-plugin:5.12.0"
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "https://jitpack.io"
}
maven { url 'https://maven.fabric.io/public' }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
我试着回到旧版本(25.0.0)的构建工具,但如果我减少它,我会得到渐变错误:
Could not find method implementation() for arguments
对于old version (25.0.0)
,请使用compile
而不是implementation
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'