【发布时间】:2018-10-13 22:29:19
【问题描述】:
我只是支持我的旧项目,因为我一直没有处理它,我发现很多错误是 gradle 中的构建错误,因为我使用编译而不是实现以及我试图解决的许多其他过程这个错误很多,但我失败了as this my window error 那是我无法识别,因为我也使用了来自 github 的旧库
这是 myGradle (build.gradle(Project:Waiterer))
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// 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
}
这是 build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "abtech.waiteriano.com.waitrer"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(':jtds-1.3.1')
implementation project(':library')
implementation project(':librarySV')
implementation 'com.android.support:support-v4:25.2.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:25.3.1'
implementation 'com.roughike:bottom-bar:1.3.9'
implementation 'com.android.support:recyclerview-v7:25.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:cardview-v7:25.3.1'
testImplementation 'junit:junit:4.12'
implementation "com.android.support:gridlayout-v7:23.1.1"
}
这是我使用的第一个 gradle 库 build.gradle(模块:库)
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '27.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
}
这是我使用的第二个库 build.gradle(Module:librarySV)
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.8.1'
}
}
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.4.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
implementation 'com.android.support:design:23.1.1'
}
publish {
userOrg = 'miguelcatalan'
groupId = 'com.miguelcatalan'
artifactId = 'materialsearchview'
publishVersion = '1.4.0'
desc = 'Cute library to implement SearchView in a Material Design Approach'
website = 'https://github.com/MiguelCatalan/MaterialSearchView'
}
希望这可以足够清楚如果有任何不清楚的地方告诉我 请注意:我没有使用 API 我使用 JDBC JTDS 连接从数据库中检索数据
【问题讨论】:
-
遗憾的是,这信息还不够。你的项目在 github 上吗?如果您无法共享您的项目,请转到您的项目目录并运行“gradlew clean assembleDebug”并编辑帖子以包含输出。它应该包含来自 AAPT2 的错误
-
非常感谢@Izabela Orlowska 我在 GutHub 上分享了项目,我会发送给你
-
听起来不错 :) 可能需要进行一些小的调整,因为 AAPT2 比 AAPT1 严格得多,并且可以及早发现大多数错误,而不是允许运行时问题
-
提取文件时出错。你能把它拉上拉链吗?或者放在 bitbucket/github 上,这样我就可以看到源代码(dropbox 不会显示某些文件的内容)
-
它已经压缩了,我会尝试,但它在 bitbucket/github 中