In my android project, i have two modules,
App module
backend module
I want to import a backend module class into one of my app module class. but when i try to import it like this
import com.me.you.backend.entities
i get an error Error:(52, 58) error: package com.me.you.backend.entities does not exist
The next thing that i tried is to compile my backend module in my app's build.gradle
like this
dependencies {
....
compile project(':backend')
}
But i get 13 warnings! of this type
WARNING: Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored
for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
And when i run my app module, i get this error
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/google/appengine/repackaged/com/google/api/client/auth/oauth2/AuthorizationCodeFlow$Builder.class
Question
How can i successfully import my backend class?
Solution was to add dependancy on backend module in my app module's build.gradle
like this
compile project(path: `:backend`, configuration: `android-endpoints`)
After this i rebuild my project (Build > Rebuild project). and everything was ok.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With