Android Studio: dx.bat failed - android

I am using Android Studio for building an application, in which I am using Facebook-SDK and Actionbar Sherlock as a dependencies. Each project library contains android-support-v4.jar.
When I am trying with any one of the project library it is working well. But I'm facing problems when trying to implement both simultaneously.
I know that I am facing the problem due to android-support-v4.jar.
I want to know how to add android-support-v4.jar in an efficient way.
\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed

I just solved the similar problem. On my case and most probably on your case also, the problem is on adding android-support-v4.jar for multiple times. I then remove the dependencies of android-support-v4.jar from my project's build.gradle and just have a single dependencies on facebook build.gradle, as facebook sdk was first to build on my project.

I faced this problem yesterday. I got it to work by making sure that there is the same android-support-v4.jar file in all libs directories throughout the project. The facebook-sdk and ABS ship with versions that might not be current when compared to the one that is installed by default by Android Studio. Let me know if it works.
If you need help integrating libraries in Android Studio, I recommend looking at facebook-sdk's step by step tutorial. I am sure once you integrate facebook-sdk you can use those steps to add any other library that you need by making small changes (i.e. use the name of the library you are trying to add instead of facebooksdk on the settings.gradle and build.gradle)

Related

Error while setting up facebook android sdk v4 in eclipse using gradle

I have been trying to get the facebook sdk v4 to work with my existing libgdx android project. Here are the steps i took:
ยน. Imported facebook android sdk v4 as gradle project to my workspace. Went well
Edited my android projects properties to include facebook sdk as library. Didnt work,couldnt import classes
Reverted 2nd step and added project to java build path. Didnt work
Added individual jar files as dependencues. Worked but not all classes could be imported maybe the one that were not included in jar?
Now I am totally confused as most of the topics online refer to older sdk.Please guide me
You can update your libgdx project to Gradle using https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle. Then you can add a dependency to the facebook-android-sdk artifact as described in 4th and 5th step here: https://developers.facebook.com/docs/android/getting-started#androidstudio.

How to Use Android PagerSlidingTabStrip library or any other gradle built library in Eclipse

I have a problem importing the PagerSlidingTabStrip library into Eclipse, I get multiple errors and I know this happens because the library was built using gradle.
I tried to follow this answer but I can't find use as source folder in the build path menu.
I've never used gradle previously and don't know how to go about this in Eclipse. Please guys, help most of us who have this problem out of our dilemma. Would be very grateful.
Okay in the end this was what i did:
I checked the build.gradle file of the library for target and min sdks. I then put what i found in the android manifest.xml which I know Eclipse uses.
I deleted the build.gradle and gradle.properties files.
Made sure the project was marked as a library. And it works!
I think the most crucial step was to check the build.gradle for the sdks and whatever else the project requires and replicating that the way it should be in the manifest file.

Android project suddenly full of errors because of different supporting librarys

So i wanted to add a facebook SDK to my android projects, the outcome was this:
I've decided to "undo" changes first so i removed the facebook library from my project
after:
The error is "R cannot be resolved", if im importing android's R it wont recognise the layouts anymore
for example:
My libs are:
I've tried removing support v4/v13 but neither helped. Im clueless, please help.
Copy/Paste the same latest v4 library in all the projects,

how to use JakeWharton-Android-ViewPagerIndicator in intellij?

Hi there I am just newer in android development and I am trying to build my first app and I do will until now.
but I need to use ViewPagerIndicator so I do my search and I've found JakeWharton-Android-ViewPagerIndicator also I am using inellij IDE
but the problem that when I want to add this library into my project I can't find the jar file and I don't know if the error from my side or what please any help.
regards
You will need to create a new module with the library sources and add it as a dependency to your main module. This answer has detailed steps you can follow. Just replace the library used with ViewPagerIndicator.

ERROR: "._android-support-v4.jar" in project FacebookSDK

Help needed!!!! Stuck for 2 weeks on this and help needed.
I've recently imported the facebook sdk for android and its projects into my workspace. It shows up errors and the problems:
Archive for required library: '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/libs/._android-support-v4.jar' in project 'FacebookSDK' cannot be read or is not a valid ZIP file
And the samples get errors along the line of:
The container 'Android Dependencies' references non existing library '/home/Documents/facebook-android-sdk-3.0.2.b/facebook/bin/facebooksdk.jar'
The things I have done following the other discussions without any success are
cleaned project
set the Facebook SDK as library
looked at the build path section and added external jar consisting of facebook/libs
imported fb sdk like 20 times and into different folders.
made sure my java compiler was 1.6
HELP would be very greatly appreciated!!!!
Take the lastest version of android-support-v4.jar (in your sdk environement : sdk/extras/android/support/v4/android-support-v4.jar) and replace in your project and library project do not create conflict.
The steps to importing a library are:
Download the library
Place the library in the libs folder of the project.
Build the project
Do Not attempt to import the library using some import wizard.
I suspect either your download was corrupted, and you need to do it again, or you put the file into the wrong directly.
I think your problem is that the android.support.v4 versions are different, take the one from your project and replace the one in the Facebook sdk lib folder, it should dismiss the clash.
As per your question, I think you are not able to compile once you add the SDK to your project. Do you get an error saying unable to run as library?
If so that means you have included this as library and create your project as a library to be used further. It is a common mistake that I have seen many people do when they try to import a library to use and tick mark the checkbox is Library. This actually means you want this project to be treated as a library for future use. Just try to add the SDK and do not tick mark the checkbox and this project will run fine.
Many forums will just tell you to tick that checkbox and you will be stuck on this error for long time.
For any .jar file related issues you have to make the .jars files compatible as there hashing a problem and the two jars are not compatible with each other (a version issue).

Categories

Resources