Using: Eclipse & ADT20
I am having issues using Jake Wharton's ViewPagerIndicator in a new project.
After following the instructions on Jake's github page I receive an error in my application when adding the library. If I look in the Android Dependencies (located; Properties > Java Build Path > Libraries) there is a library.jar referenced but it has a red cross and says "missing".
On github page it says "A standalone JAR is not possible due to the theming capabilities offered by the indicator widgets." so why is my project trying to reference one?
I have tried removing the Android Dependencies and cleaned the project with to no avail. I've ran "Add Library Support" and "Fix Project Properties"
Any help would be much appreciated.
EDIT:
The solution can be found here: Using Jake Wharton's ViewPageIndicator
I had the same issue
I removed my project from Eclipse and copied it beside library project
then add my project and library project to Eclipse again and in project.properties file of project replaced this
target=android-7
android.library.reference.1=../library
also changed target SDK of library to 7
really strange but worked
I created a new Android Library Project, copied over the files from ViewPagerIndicator's "library" subdirectory and then (to fix some problems with some Holo themes not being found) edited the project.properties to:
target=android-14
This last bit at least meant the library project would compile. I have no idea why it is initially set to level 4.
https://github.com/JakeWharton/Android-ViewPagerIndicator/blob/master/library/project.properties
Related
I'm using Eclipse for build an Android project. when I try to open bellow item :
file --> new --> Android Application Project
Then when the project is built a series errors displayed :
I am a beginner in this regard and thank you for your help.
Open AppCompactv7 and add as library on your project
The problem is with your appcompat_v7 project. Delete the existing project one in the workspace and re-import it from
\sdk\extras\android\support\v7\appcompat
After that try cleaning the project.
Project -> select Clean -> select the project.
1 - Make sure library project(appcompat_v7) is open & is proper referenced (added as library) in your application project.To do this follow this steps: right click in your project -> "Properties - Android - Add"
2 - Delete android-support-v4.jar from your project's libs folder(if jar is present).
3 - Appcompat_v7 must have android-support-v4.jar & android-support-v7-appcompat.jar inside it's libs folder. (If jars are not present copy them from /sdk/extras/android/support/v7/appcompat/libs folder of your installed android sdk location)
4- Check whether ActionBarActivity is properly imported. (In your case this is right)
import android.support.v7.app.ActionBarActivity;
Here is a good example of how to create a project in Eclipse using v7 Support Library
Finally because you are a beginner I'll recommend you to use Android Studio as it is the official environment for developing for Android. Configuring the SDK can be quite a pain in Eclipse. You can also take advantage of the Gradle dependency system and simply specify which libraries you would like to use and Android Studio will automatically fetch the jars from online remotes as required. I think its the future of Android Application Development.
I want to use CastComponaionLibrary but I'm using Eclipse and not Android Studio.
So I created a new project and copied all CastCompanionLibrary sources into it.
I also added references to:
android-support-v7-appcompat
android-support-v7-mediarouter
google-play-services_lib
In this new project I get these compilation errors:
The project was not built since its build path is incomplete. Cannot find the class file for android.support.v4.app.ActionBarDrawerToggle$DelegateProvider. Fix the build path then try building this project
The type android.support.v4.app.ActionBarDrawerToggle$DelegateProvider cannot be resolved. It is indirectly referenced from required .class files VideoCastControllerActivity.java
any ideas?
Thanks!
First, you don't need to include v4 library since that is part of the v7 libraries, so remove that. Then follow the instructions in this G+ community post
I don't know why but I solved this problem:
In android.support.vX -> Properties -> Java Build Path -> Projects -> Add
Choose the related project/s to the android.support.vX
Press OK
Do the same and remove the project/s added
I am using appcompat_v7 library and facebook sdk in my project and both the library have android-support-v4.jar.If I delete any of the jar the corresponding library is not working and having both jars is not allowed.
What should I do? Kindly help me out...
The conflict is due to different versions of the jar.
Make sure you have the update support library from the android sdk manager
Copy android-support-v4.jar to libs of both the projects. The jar can be found #
android-sdk/extras/android/support/v4/andorid-support-v4.jar
Clean and build your project
remove android-support-v4.jar from FACEBOOK SDK and add android-support-v4.jar as external jar facebookSDK properties -> java build path -> libraries -> add external jar (i had remove this problem like this )
Try removing the dependency library from both appcompat_v7 and your project. To do that got to build path=>configure build path. Then select the dependency library and click on remove.
Add the support library by Android Tools=>add support library.
Do this to both projects.Then you are good to go
Its really simple
Just right click on your project as well as on the library project >android tools >Add support Library.
This will update your support library to the latest which solves the problem.
This question is ask many times while everyone are start-up android development in learning stage.
I think everyone has same environment of android but they configure differently according to projects.
I had same issue while creating new project every time and i found solution on below.
I added library appcompat_v7 into project and remove jar android-support-v4.jar from lib folder of my new project and blink ERROR was gone.
Add appcompt_v7 library project
Remove android-support-v4.jar from project lib folder
Wow error was gone
Best way to fix this issue is to look out for both jar files path. If you have "appcompact folder" in your eclipse then look into libs folder. In libs folder you have jar files.So, It's better to remove jar files from your application folder. Then at the time of compilation it will take jars from "appcompact folder".Don't keep jars in your app folder which leads to "Jar mismatching error". Error is mentioned below:
Found 2 versions of android-support-v4.jar in the dependency list,All versions of the libraries must be the same at this time.
Path: /home/vinny/workspace/appcompat_v7/libs/android-support-v4.jar (Keep this jar as it is)
Path: /home/vinny/Downloads/Demo/libs/android-support-v4.jar(Remove this Jar )
Jar mismatch! Fix your dependencies
Note : Remove jars from this path "Path: /home/vinny/Downloads/Demo/libs/android-support-v4.jar" T(Application's folder path)
Safdar Akrami is right, but also to do it on facebook SDK project!
Just right click on your project as well as on the library project >android tools >Add support Library.
This will update your support library to the latest which solves the problem.
if you have problem with the other projects that depends of facebook SDK project, you can fixed in this way:
Fix Project Setup
Add project "appcompat_v7" to build path of FriendpickerSample for example
Try removing the dependency library from both appcompat_v7 and your project. To do that got to build path=>configure build path. Then select the dependency library and click on remove. Add the support library by Android Tools=>add support library. Do this to both projects.Then you are good to go
I want to use the new ActionBarActivitiy class from the v7 support library but I cannot find the support JAR anywhere. I have a v7 folder in my extras directory but it contains 3 directories and not a jar
In Eclipse right click on on your Project -> Android Tools -> Add Support Library... and follow the instructions. As the result, required jar-file gets copied into your project's libs folder. Or you can add libraries manually how it is described in Android documentation.
Update 1: Android Tools team has made some changes to the way support library is integrated.
Android updates do this a bit different. There is still Android Tools -> Support Library option, but now it behaves a bit different. Once activated, Eclipse will silently create a new project called appcompat_v7 or similar. The name might change in the next versions of ADT. You must be able to find this project in your workspace. This project contains android-support-*.jar file. This is a new library project. In turn, your project receives a dependency on that library project.
You can stay with the updated configuration "as is" and start using compatibility API. Or alternatively, you can copy android-support-*.jar files into your project's lib folder and remove dependency on appcompat_v7 library project. Both options will work just fine.
Update 2: They change this behavior quite often. Try Project -> Android Tools -> Add Support Library... first. If it doesn't work, please check out official documentation for more recent information.
Update 3: It is really worth to migrate to Android Studio to avoid multiple issues with ATD nowadays.
ActionBarActivity is in an Android library project, not a JAR. There are instructions in the Android developer documentation for how to add an Android library project to your environment and attach it to your application project.
You have to update your Support Library through your SDK and then navigate to the folder where your SDK is located! Then go to : Extras->Google and you will find the Project and the jar included!
I have two Android Library Projects in Eclipse (yes, "Is library" is selected in both of them).
One of those is ActionBarSherlock, the other one is ViewPagerIndicator
Now, ViewPagerIndicator must include ActionBarSherlock as a library dependence, so I add it under the "Android" settings of the project. Problem is, in the moment I add the library dependence, if I go to Java Build Path of the same project I can see that the dependence .jar of the added library is required but not present (of course, as it is a library project, no jars are created!).
What can be the problem? Furthermore, I have to add both libraries as dependences to an Android application, which presents the same issue.
Are you using ADT14? If so, you probably need to migrate the library projects to the new structure. Right click the library project and select 'Fix project properties' from the Android tools menu.