2

I have created an android application and wants to add that as a module to other application. I tried to import the application using: File->New->Import Module->(browse application to import)->(change module name)->Finish

After importing the application following changes happened:

setting.gradle

import ':app'
import ':ocr'

build.gradle(Module:app)

implementation project(path: ':ocr')

And the module got added to the project.

But when i tried to sync the project, it show the following errors:

ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :ocr.
ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve project :ocr.
ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve project :ocr.
ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve project :ocr.
ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve project :ocr.

I tried to search for the issue all around but unable to fix it. Can anyone tell where is the problem or how can it be fix?

  • be sure the build.gradle in ocr module has "apply plugin: 'com.android.library'" instead of "apply plugin: 'com.android.application'" – Ignacio Tomas Crespo Dec 02 '19 at 08:44
  • yes i changed "apply plugin: 'com.android.library'" instead of "apply plugin: 'com.android.application'", but it throws another error as ERROR: Cause: java.lang.NullPointerException. since i am using firebase ocr i need to add "apply plugin: 'com.google.gms.google-services'" and "classpath 'com.google.gms:google-services:4.2.0'" in settings,gradle – JYOTIRMAY GHOSH Dec 02 '19 at 09:31

0 Answers0