Build error in android studio

I get this error when I do gradle online.

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. 

Where ProwessPride_V1.01 is the jar file that I include in the project.

I am doing Invalidate Caches / Restart in the studio. rebuild and clean up the project, but I cannot solve this error. So please help me how can I solve it.

build.gradle

  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') } 

Project buil.gradle

// Top-level assembly file, where you can add configuration parameters common to all subprojects / modules.

 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() } } 
+5
source share
2 answers

By defining compile project(':ProwessPride_V1.01') , gradle searches for a project with the same name in settings.gradle .

Since it is a can, it is wrong.

Just delete this line.

 compile project(':ProwessPride_V1.01') 

If you add the jar to the libs folder, this line is enough for you.

 compile fileTree(include: ['*.jar'], dir: 'libs') 
+1
source

Follow these steps:

  • Discard the changes made when adding the library (remove any dependencies or JAR)
  • Drag n Drop the jar file in the libs folder (inside android studio)
  • Clear assembly
+1
source

Source: https://habr.com/ru/post/1236322/


All Articles