android studio中的构建失败
当我让gradle在线时,我得到了这个错误android studio中的构建失败,android,android-studio,gradle,build.gradle,Android,Android Studio,Gradle,Build.gradle,当我让gradle在线时,我得到了这个错误 Error:Gradle: FAILURE: Build failed with an exception. * What went wrong: Task 'testClasses' not found in project ':ProwessPride_V1.01'. * Try: Run gradle tasks to get a list of available tasks. Run with --stacktrace option t
Error:Gradle:
FAILURE: Build failed with an exception.
* What went wrong:
Task 'testClasses' not found in project ':ProwessPride_V1.01'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
其中,ProwessPride_V1.01是我在项目中包含的jar文件
我确实在studio中使缓存无效/重新启动。重建和清理项目,但我无法解决此错误。所以请帮我解决这个问题
格雷德尔先生
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.technopits.dcn"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.android.gms:play-services-gcm:7.3.0'
compile project(':ProwessPride_V1.01')
}
格雷德尔大厦项目
//顶级生成文件,您可以在其中添加所有子项目/模块通用的配置选项
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
按照以下步骤操作:
定义
编译项目(':prowessprede_V1.01')
,gradle正在设置中搜索同名的项目
既然它是一个罐子,那就错了
只需删除此行。
compile project(':ProwessPride_V1.01')
如果将jar添加到libs文件夹中,这一行就足够了
compile fileTree(include: ['*.jar'], dir: 'libs')
将ProwessPride_V1.01 jar文件放在您的projects libs文件夹中,并从依赖项和complie中删除该行compile project(“:ProwessPride_V1.01”),它会工作的。您能告诉我如何将jar放入libs folderDrag and Drop或通过在资源管理器/查找器中复制+粘贴,但仍然需要添加以下行:compile文件吗('libs/ProwessPride_V1.01')
进入您的gradlefile@Erythrozytcompile file('libs/ProwessPride_V1.01')行不是必需的,因为compile fileTree(包括:['*.jar'],dir:'libs')将在lib文件夹中自动将jar文件添加到gradle中。哦,是的,这是真的,覆盖这一行“add as library”不是必需的。compile fileTree行是必需的(包括:['*.jar'],dir:'libs')就足够了