0

I'm trying to create an app for android (google Tango) that uses thrift to send some information to a client. I take a sample Tango app which runs without Thrift. Then when I add try to add some of the Thrift dependencies (like slf4j-log4j12-1.7.12.jar) I suddenly get errors like

error: package com.google.atap.tangoservice does not exist

I don't get what's wrong, it worked before... Why does this happen, and how can I fix it?

Thank you


UPDATE

The way I added the library was by clicking right on App>new>module then I chose import jar, and selected the jar. Then I went to project structure and in dependencies I added the module of the jar I imported.

Adding it like this did not help me resolve the conflicts I had before:

import org.slf4j.Logger;

giving me the error "cannot resolve symbol 'Logger'". And it also introduced the errors previously mentioned.

Girauder
  • 165
  • 1
  • 12

2 Answers2

0

Have you tried adding a dependency to your build.gradle file like this:

dependencies {
    compile 'com.google.atap.tangoservice'
}
Eamon Scullion
  • 1,354
  • 7
  • 16
  • Adding the line you mention didn't fix the problem. It still tells me : "cannot resolve symbol 'atap'" – Girauder Dec 07 '15 at 21:22
0

If you are using local jar dependency then add it like this to the build.gradle:

dependencies {
    compile files('libs/something_local.jar')
}
daniel.keresztes
  • 875
  • 2
  • 15
  • 25
  • I don't have a files folder, the way I added the library was by clicking right on App>new>module then I chose import jar, and selected the jar. Then I go to project structure and in dependencies I added the module of the jar I imported. Would I still neeed to do what you say? – Girauder Dec 07 '15 at 21:18
  • you should put the .jar to the libs folder in your project (Yourproject/app/libs/), then use the dependency what i wrote. – daniel.keresztes Dec 07 '15 at 21:23
  • I've seen a video where this is done, but i don't have the create directory option. I have a "new> android resource directory" option. Is this equivalent? If so, what should the resource type be? Thanks – Girauder Dec 07 '15 at 21:50
  • Just navigate to the project folder in your operating system, then there create the "libs" folder in the "app" folder. – daniel.keresztes Dec 07 '15 at 22:05
  • I get the error: Gradle DSL not found: 'compile()'. Possible causes: The project 'QuickstartJava' may be using a version of the android Gradle plug-in that does not contain the method, etc. There is a comment in the gradle file that says: "Note: do not place your application dependencies here; they belong in the individual module build.gradle files" – Girauder Dec 07 '15 at 22:27
  • put the dependencies in the app's build.gradle – daniel.keresztes Dec 07 '15 at 23:01