I know that there are different solutions with different libraries posted. But, could anyone help me with this one?
I've busting my head for the past couple of days, and I really don't know what to do. I already tried importing the modules in all the suggested ways from different posts. (Project Structure --> Dependencies --> Add dependencies), etc. My project does not show any errors, but when I run it, it throws me a compilation error that complains about some classes missing. The library only depends on the ViewPagerIndicator's library which I also imported.
here is a picture. Thanks!!!
NOTE:I also have tried it with Eclipse, but the problem is different there. The app crashes when I run it. When I uncheck isLibrary from Properties -> Android and erase those libraries, the app works.
Inspired by this answer, these are the steps I did:
Put the jar file (in my case, 'xxx.jar') into the libs folder of your project
Right click it and select Add as library
Type this in the dependencies part of build.gradle file: compile files('libs/xxx.jar')
Do a clean build. It can be done inside the android studio, but I also ran the gradlew.bat included inside the project folder
Now, the project should be built and run just fine.
You are referencing the library wrong. You need to add the dependency in the build.gradle file. I recommend you to read the documentation first. It's a long read, but totally worth it.
I noticed that a user uploaded the library as .aar file in his maven repo. You might want to use the library from his repo. The setup is very easy (you only need to include the dependency of the better picker library).
Related
I'm trying to merge a project called Termux-app from github with its extensions (termux-boot, termux-api, termux-float all opensource from github) to complete it i used the answer given here and it seems to work with termux-app and termux-boot but when i tried to do it with termux-app and termux-api i found some problems, I've been trying to understand what does the errors mean but i had no success.
Some posts said that probably it was because of android studio gradle 3.0 migration but i've checked the xml files of termux-api and it seems to follow the suggestions.
So i have no idea why after adding the module to termux-app and rebuilding the project i got the errors:
The steps that i did to make termux-app and termux-boot work are this:
Download both projects.
Modify the build.gradle of termux-boot and made it a library deleting the ApplicationID, shrinkResources line and changing 'com.android.application' to 'com.android.library'.
Rebuild to generate the aar file in order to add it to termux-app project
From termux-app project click on menu 'File/New/New Module' added the file aar.
Added the dependecy by clicking on 'File/Project Structure/', click on 'app', click on 'dependencies' and on '+' in order to add the dependecy.
Android studio will show a problem with the manifest merged, open the manifest file and clicked on all the 'suggestions' of android-studio to solve the problem.
I repeated the same steps to merge termux-api and termux-app but it didnt work.
It isnt a questions related only to this termux-app but its more about 'the right way to merge two android-studio projects from github'
I Found out that this method was right, It is elegant and works.
My problem was that i had to add a dependency that was in Termux-api and that Termux-api wasnt able to find its resources.
In order to solve this I copied and pasted all the resources from Termux-api to Termux-app and I added the dependency:
implementation 'com.android.support:design:27.1.1'
that was supposed to be called from Termux-api.
I have ran into a little problem with very late wanting to move on to gradle with my intellij android project.
Now I have got some trouble with the dependencies. I already know how to add dependencies from given repositories.
I have a whole project in our libs folder, that also is an android project. Now I'm not really sure where/how to put this or whether it is possible to tell gradle that there is a whole project as a dependency. I have to say that the second project is not using any buildscripts so it is not a Gradle-Project.
As for now it is just a directory in our libs folder, and I think it's closer to some kind of sourceSet, but as I'm still new to gradle and I was not lucky finding anything related to my problem I hope you could help me out with a little hint.
For 4 days now I have been trying to get this TwoWayView Library to work in Eclipse. I am not sure if the issue is me or Eclipse. Since I updated Eclipse two weeks ago it has been nothing but a nightmare. Anyways, I downloaded the TwoWayView Project from GitHub, Imported into Eclipse as existing Code, Set project as Library. That should be it for the TwoWayView Lib.
In my project I Right Click> Properties> Android> Add> (Select TwoWayView)> Apply>.
I have Right Click> Properties> Project> Add TwoWayView>.
So far, nothing. I have read in 3 blogs about how simple it should be by just importing the project and using it. Even Lucas' instructions are 3 steps and for the life of me can't figure out how in the world it could sound so simple yet I can't get it to work at all. Has anyone got this to work and if so, HOW?
you could try using gradle, simply add this line to your dependencies in build.gradle: compile 'org.lucasr.twowayview:twowayview:0.1.1'
Just today I had the same problem as you, but I'm working with Android Studio, but I hope you serve.
It turns out that the content of the project is not the library, are just some of the folders that are within twoway-view-master so you have to go one by one and only necessary. Only you need to include the following folders:
core
layouts
Here are the steps to follow:
Download the library project TwoWayView of Lucasr
Create, in your Android project you're working in a new folder. In C:\Users\your-user\AndroidStudioProjects\your-name-of-application\ create a new folder called libraries.
Within the libraries folder created, paste the library project TwoWayView you just downloaded (twoway-view-master folder).
In the project tree of our IDE us that new folder (libraries) will appear. Access the settings.gradle of libraries and add the following lines of code:
include ': app'
include ': libraries: twoway-view-master: core'
include ': libraries: twoway-view-master: layouts'
Now go to the libraries/ twoway-view-master/core and access build.gradle folder. Change this line of code:
apply from: "${rootDir}/gradle/scripts/gradle-mvn-push.gradle"
By the following:
apply from: "${rootDir}/libraries/twoway-view-master/gradle/scripts/gradle-mvn-push.gradle"
Perform step 5 but this time with the build.gradle file layouts folder.
In the build.gradle file layouts folder, you also have to change the line:
compile project (':core')
By the following:
compile project (':libraries:twoway-view-master:core')
Finally you just have to access the build.gradle of your project and add the following lines in the section dependencies:
compile project (':libraries:twoway-view-master:core')
compile project (':libraries:twoway-view-master:layouts')
If you do not understand very well what to do, this question is the solution that gives the user prudhvi.
https://stackoverflow.com/a/32402832/6129931
EDIT: However, since Google launched the Android version L, exist the called RecyclerView, there that can do everything you do with TwoWayView, i.e. can create lists and grids in horizontally and vertically. I recommend you reports about it rather than use separate libraries because Google is starting to demand their use.
Here you can get information about RecyclerView use in horizontal and vertical:
https://stackoverflow.com/questions/36355506/learn-step-by-step-to-use-the-recyclerview-in-android - StackOverflow
Hope this can help you.
I have installed facebookSDK and the sample apps. The sample apps all copilr and run fine.
I tried to make my own app. The only thing I did was creat a new android project, test it, runs fine. Then I added the facebooksdk jar file. Now my project no longer runs and I get a error that says
“jar miss match fix your dependencies”
The jar file seed to load in correctly, if I click on android dependences I see
Facebooksdk.jar ../programming/facebooksdk/……
I tried to see what was different from my project ans facebook's sample code.
Under android dependencies it had the same line I had Facebooksdk.jar ../programming/facebooksdk/……
And also had another jar file called android-suppert-v4-.jar that I do not have.
Other then that both the sample code and my test project seem to be the same.
there is a jar that exists both in the facebook sdk project and in yours.
This is caused by having a duplicate jar -- a .jar file of the same name that appears in both projects, but is not the exact same file. In this case, it is probably android.support.v4.jar, since Facebook uses it, and your project likely does too.
Check your dependencies carefully (and check your assets, bin, etc. folders) for the android support library in your own project -- even if you didn't add it yourself, the dependency could have been added by default, especially if you used the wizards provided with ADT for eclipse.
This has been driving me absolutely crazy. There's 101 answers to this kind of problem scattered across Stack Overflow but nothing seems to work for me.
Here's the story:
I downloaded the Aviary SDK (if that's relevant) and imported their library project into my workspace
I added their Library under Project -> Android -> Add.. and it's checked off there
The JAR (aviary-sdk.jar) containing the class that apparently is missing at runtime (com.aviary.android.feather.FeatherActivity) is listened under Android Dependencies in Project -> Java Build Path
The project builds correctly, but at runtime it throws a java.lang.NoClassDefFoundError when trying to launch this activity
I've tried a bunch of things (checking and unchecking things in Order and Export, reordering things there, etc.) but nothing is taking. I also tried just manually including the JAR in the /libs folder, but this SDK depends on a bunch of other things in that library project (e.g. themes) and having the SDK referenced twice doesn't work either.
I'm completely stumped here. I've looked at all kinds of other answers and nothing seems to work. I'm starting to get the feeling that this method of referencing other libraries is no longer supported...?
Edit: I've created a fresh Android project and reproduced the problem there, too. I suspect it has to be something stupid in my build environment:
Have you tried importing the aviary-sdk.jar as an external jar?
Copy the aviary-sdk.jar into the libs folder on your project
Right click on your project, Build Path -> Add External Libraries
Add the aviary-sdk.jar from your libs folder inside your project
Hope this helps, Good luck ^^
Try a few things,
Number 1: Regarding conflicting jars, it's probably refering to the support library. So go ahead and right click on your library project, and select the option 'Add Support Library'. This downloads the most recent support library, then do the same for your own application project.
The problem is that the library may be using a different support.jar than yours.
Number 2: If that doesn't fix the issue, go to your project properties, Java Build Path, and select 'Order and Export', and make sure that both 'Android Private Libraries' and 'Android Dependencies' are checked.
Clean the project, and try running again.
Figured it out.
After trying everything in the settings, I decided it was the IDEs fault. I deleted my ADT and started a new one, new workspace, imported all my projects (as-is), and launched from there. Everything works.
I guess this is my punishment for always complaining about how Vim was better than any IDE... Ya got me, Eclipse.
disgruntled sigh