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

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).

Related

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.

Error while running Calendar project

I have downloaded calendar project from https://github.com/android/platform_packages_apps_calendar and now I'm trying to run that project. I imported the project to eclipse via new --> Android project from existing source, it imported successfully but I'm getting a red exclamation mark in project, like this:
When I went to properties > Android I'm seeing this:
It looks like the project is using some libraries but is not able to find in the workspace. How can I fix this?
You may to add the following dependencies as well.
https://android.googlesource.com/platform/frameworks/ex/
https://android.googlesource.com/platform/frameworks/opt/colorpicker/
https://android.googlesource.com/platform/frameworks/opt/calendar/
https://android.googlesource.com/platform/frameworks/opt/datetimepicker/
https://android.googlesource.com/platform/frameworks/opt/timezonepicker/
I was able to build the AOSP Android calendar.
Ye Lin Aung give you almost all the neccesary, but you will need also "chips" library. This library is not included in the last master aosp necessary packages , but its in their repository in the old versions.
You can find the neccesary libraries in the next repository:
https://gitlab.com/Purcallas/AOSPCalendarExtensions/tree/master
Or in the Google repository (as say Ye) you can find chips and common values:
https://android.googlesource.com/platform/frameworks/ex/+/ics-mr1
remove all the library from here and import each and every one in your project workspace and then after add the library.

Problems converting to library project including Facebook SDK

I have a working app that I've now converted to being a library project in Eclipse. When I attempt to include the library as a "Project Reference" in an empty app (no other functionality other than what it inherits from the library) it fails to build. I get the message Unable to execute dex: Multiple dex files define Lcom/facebook/android/R$attr;.
To try to work around this I tried to delete the Android Dependencies completely. But then I get a "Class not found exception" for classes in the library.
Is it possible to remove the Facebook dependency without also removing the app library dependency? I tried to delete the facebooksdk.jar file but was unable to do so since all the buttons are grayed out. (see screen capture below)
I also tried simply unchecking "Android Dependencies" in "Order and Export". That had no effect on the problem.
Your suggestions are welcome.
FYI, my project has 3 main components. All 3 are contained in the same Eclipse project folder (see screen capture):
Application "App_A"
Library_L (included as Project Reference in "A") It's worth noting that Library_L executes perfectly when I run it as a non-library project.
Facebook SDK 3.0.2 (included as Project Reference in Library_L (see screen capture)
Project References are used to include a library project (e.g., the Facebook SDK).
The documentation -- and books by balding guys -- show you how to attach an Android library project to your app, and it has nothing to do with "Project References".
Similarly, the documentation for the Facebook SDK shows you how to attach their Android library project to your app (see Step 6). They follow the standard Android library project approach, and that too does not involve "Project References".
Now, it is conceivable that there's something about a newer Eclipse version (I'm running Indigo) that causes "Project References" to show Android library projects as checked -- it does not do so in my version.
Make sure that you have properly set up the Android library projects, and see if that helps with your issue.

SmartWatch sample installation

I would like to compile the sample provided by Sony for his SmartWatch. I followed the instructions in this page. But when I added the the SmartExtensionUtils project I saw lot of errors like: com.sonyericsson.extras.liveware.aef cannot be resolved to a variable. Instead this import com.sonyericsson.extras.liveware has no problem.
Did someone find and solve this issue?
In order for the EightPuzzleGame to compile, you need to add the following library projects that are available in the SDK:
SmartExtensionAPI
SmartExtensionUtils
SmartExtensionInternalUtils
In your case, it is the API project that is probably missing. You can see what library projects that are missing by checking the project properties. Example:
What you need to do is go to the properties page of the SmartExtensionUtils library and in the library box add SmartExtensionAPI as a dependency
This is a link to my desktop screenshot. SmartExtensionAPI and utils are in the project list (left side) but the EightPuzzleExtension does not find them
You don't need SmartExtensionInternalUtils project. When you create project from existing source, check Import project into Workspace. In this way EightPuzzle, SEAPI and SEUtils will be in the same directory and you'll not have no errors :)
I had this problem too. What i did is to solve it, is to import from the Sony samples in the Sony add-on SDK 3.0 the SmartExtensionAPI first and than SmartExtensionUtils. If these samples are build correctly the other samples will build correctly as well.
Go to File|Import, choose SmartExtensionAPI as your root directory and click finish. Maybe you have to change the compiler compliance level to build it correctly. After this do the same for SmartExtensionUtils.

Android Library Dependencies broken after SDK/ADT-Update

Today, I updated my Android SDK and Eciple ADT to the most recent versions (ADT Rev 22). After restarting Eclipse it is quite unhappy with the Build Paths whenever I reference custom libraries.
An example is shown in this screenshot:
My custom "Android Utilities Library" compiles fine, but everything that depends on it shows build path errors. E.g. when I investigate the build path settings for "Android URA Library" it shows me an error with the android_utilities_library.jar missing under "Android Dependencies" (which in fact is true, the libraries will be built to individual class files in bin/classes).
After reading the solution to Build path errors with library projects I tried to clean and manually build my projects in the correct order, but to no avail.
I've never dealt with this before, so I don't know how to attack the problem.
Any help is appreciated. Thx!
Installing the new Build Tools did the trick. They were not automatically included when I updated the SDK (probably need to run the update twice I guess).
I found a solution that works for me:
Go to Project Properties > Build Path > Order and Export
Then you have to check each checkbox.
In my case my libraries were restored
I hope it will help.
I can see that your project Android URA Library is referring to Android Utilities Library, then the problem should not relate to SDK/ADT update.
Please check:
Project Properties of Android URA Library, choose Project tab and make sure you added Android Utilities Library as dependency project. Otherwise, please add it.
If the problem is still existing, then Projects \ Clean All Projects
Go to libraries and check the build path of the dependent libraries. It should be same as your projects build path.
if you have import all the Dependencies in your workSpace.maybe you can:projetc-->build all.
I meet the problem,and it works well

Categories

Resources