0

I recently started developing my really first Android Project using Android Studio 3.1.2.

Therefore I implemented a module library into my app, by cloning it from github, imported it as module library and added a dependency via right-click on app > module settings, switch to dependency tab, hit the +, select imported_module.

Additionally I checked my build.gradle(Module:app), if the dependency has been added correctly, there this line appeared:

dependencies {
    ...
    implementation project(':imported_module')
}

Also in the settings.gradle file it says:

include ':app', ':imported_module'

Now if I want to access features of imported_module any of them can't be resolved. I browsed the official and the common forums for hours to find the one step I obviously missed but wasn't smart enough to find the solution.

Synching the project with gradle files didn't cause any visible effects

What do I still have to do to be able to use all the fancy stuff fro imported_module inside my app? Do I have to import it in a certain way? Or do I have to modify my AndroidManifest of my app somehow? Thanks in forward!

EDIT: could it be that my app and imported_module obviously have different package names? The Project File Tree says com.domain.example.my_app for the app and com.domain.example.imported_module for imported_module. Do I have to squeeze the one into the other?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
procra
  • 535
  • 4
  • 29

3 Answers3

1

It could have been much easier, if you had mentioned what exactly you want to access in main app. May be access specifier of the member in your imported_module is private.

Veeresh P
  • 436
  • 3
  • 15
0

I kinda worked around the whole thing, by just adding a remote dependency in my build.gradle file of a new project, pasted my java classes and my res into this new project, synched it and now it runs. Nevertheless thanks for thy help!

procra
  • 535
  • 4
  • 29
-1

That should be really all. Be sure to sync your project with Gradle files (File - Sync Project with Gradle Files).

Sheler
  • 3,969
  • 3
  • 12
  • 21