Could somebody explain how I can use the Fragments backport? I downloaded the compatibility package with the manager, but I can't find the library that I have to link to my project to use fragments.
Thank you
In your SDK installation directory, you will find extras/android/compatibility/v4/android-support-v4.jar. Add this to your project's libs/ directory, and if you are an Eclipse user, also add it to your build path.
One thing though. There is a bug in the "stock v4" android jar which is pretty annoying - you cannot receive result of any activity started from within fragments, which makes it pretty much unusable for a lot of problems. There is however a fixed version of the jar which solves the problem (until v5 is in place I guess):
http://dev.polidea.pl/ext/android-support-v4-with-onActivityResult-fix.jar
And the issue is described here:
http://code.google.com/p/android/issues/detail?id=15394
Related
I'm using Crashlytics (part of Fabric now) in my eclipse Android project. The four automatically added Crashlytics libraries don't get recreated in my project after deleting them from file system.
Restart eclipse doesn't help
Reinstalling Fabric plugin doesn't help
The plugin says it's installed correctly, but I can't import:
io.fabric.sdk.android.Fabric;
com.crashlytics.android.Crashlytics;
Has anybody come to a similar situation?
Detailed description of how that happened for me:
When I installed the plugin for the first time, the plugin integrated into my project. It added a couple of .properties files and also 4 libraries (nested them weirdly to my project folder under /kit-libs/ and also added them to my workspace even though just one was set as a library project to my project).. Uhh, well, can't say I like this way of integration.
Anyway, I removed these automatically created libraries because I switched to an old commit of my project which hadn't used Fabric at that time and I needed to make a build quickly. I don't use any build tools for this project and I didn't find any information about how to remove the plugin, so I just deleted the libraries from file system and removed the library project.
When I switched back to current commit, the libraries got recreated. But I needed to do the same thing once again, so I switched to an old commit, deleted the library folders, removed library project and did my thing. However, after I switched back to a new commit, the 4 libraries don't get recreated anymore.
Will be glad for any tips.
I eventually managed to get the libraries back to my project by checking out another commit (which included them).
After the library folders were back, I added /kit-libs/com-crashlytics-sdk-android_crashlytics as a library project to my project and everything worked again.
Now thinking about it, it may have been git's fault.
I also contacted Fabric support team and this is what they replied:
Try onboarding that app again by going to the plugin and clicking +
New App in the right hand side. If you've removed all traces of
Fabric, you should be able to re-onboard it, no problem.
However, I believe I removed all traces of Fabric, tried this and it didn't work - added my app to Fabric again, but it didn't recreate the libraries. It's hard to say what they mean by all traces of
Fabric, it's not documented anywhere. Possibly it's:
/assets/crashlytics-build.properties (*)
/kit-libs
/res/values/com_crashlytics_export_strings.xml (*)
/crashlytics.properties
/kits.properties
That's what I particularly don't like about this tool, it spreads its files all over the shop without you even knowing.
Another thing is, they also don't explicitly tell you that you shouldn't commit two of these files (*) to source control. You find out only by exploring the new files and noticing a comment:
Do NOT modify, delete, or commit to source control!
I had a similar issue, but my requirement was not to allow the twitter kit provided by Crashlytics (Fabric) to recreate itself every time i start eclipse.
I tried deleting the libraries from kit-libs but every time i restart eclipse the twitter kit was automatically added back into my project. I dug deep into the issue and found that there is file called kits.properties (you can find this next to your manifest file or somewhere down the lane).
This file specifies the Crashlytics libraries that needs to be loaded into your project. In my case i removed the package name com.twitter.sdk.android:twitter:1.1.0 (i only needed the twitter kit to be removed) which eventually stopped the re-creating process.
For your case, you need to put back the line com.crashlytics.sdk.android:crashlytics:2.1.0 into the file and restart eclipse for the library to be recreated. Please note, the package specified varies based on your installed version. The package name given above is the most recent one.
I had similar issue com-crashlytics-sdk-android_beta is deleted and project starts giving error that the com-crashlytics-sdk-android_beta file not found.
I cleaned all projects and this makes every thing working fine. Fabic added new library for the project.
Clean projects Step:
1) Go to Projects in eclipse from menu.
2) Click Clean.
3) Select clean all projects.
I had a similar issues with the crashlytic libraries .jar files missing and not being re-built. The error message I got was: "The container 'Android Dependencies' references non existing library" for com-crashlytics-sdk-android_answers, _beta, _crashlytics, _crashlytics-core.
After many tries and searches over several days, I tried again and there was an upgrade of crashlytic. The upgrade itself did not solve the issue but the steps described by ValayPatel and georgiecasey in this post (note, I'm not working with any facebook APIs in my app):
The container 'Android Dependencies' references non existing library 'facebook-android-sdk\facebook\bin\com_facebook_android.jar'
it worked! Thanks to both!
Hope it helps who ever else gets that problem...
How can I solve this? I had tried many things in here, and nothing seems to work for me.
I had tried importing and cleaning, buildings and restarting eclipse, and nothing seems to work.
"You have problems with your imports probably your project are using the same two libraries (older and new) and do not know with one should be used.
Check your Libs files, lib-project and references"
I finally found the solution.
This error happens when I added a library that is the same I am using in my project, so, I need to exclude the library from my main project and let just the one that comes with the library I imported to my main project.
So,
1. Go to bould path -> Order and Export
2. Uncheck the jar that is the same that the imported library uses. Click ok.
Now, you are ready to continue developing!
I had bad experiences with this annoying issue, it's seldom how both of you explain, older and new but in essence, problem is beyond an older/newer version of a library.jar, this problem may also appear i.e. with a class with the same class name classA and the same package name com.same.package of libraries.jar of different vendors.
In this case, we have no more choice than rename a package name or a class name. Another risky choice is to purge a class if we know, we won't use anymore.
I've been searching the internet for two days now, and I feel like I've tried everything.
Please let me know if any code snippets might be helpful in finding a solution.
I've created an android application with the standard login activity. In the doInBackground()-method, I invoke a static method from another external class. Since this method will be invoked once the submit button is clicked, the error occurs during runtime. The class is included in my file, and there are no compilation errors. Whenever I tap/click on the Submit-button, I get a java.lang.NoClassDefFoundError referring to a class (in my external jar) that is used and properly included in my external file I refer to in the doInBackground()-method.
All my external libraries are in the 'libs'-folder. I've tried adding them to the build path manually instead and checking the boxes next to them in the 'order and export'-tab instead of the checkbox next to the 'Android Private Libraries' entry. I've tried putting the 'gen'-directory above the 'src'-directory, which didn't change anything either. Restarting eclipse, reimporting the project as a whole, playing around with the order of the external libraries in the build path, fixing project properties and cleaning the project over and over, nothing helped. I've checked this
http://javarevisited.blogspot.de/2011/06/noclassdeffounderror-exception-in.html
and tried every solution, but none of them worked for me. I ad a similar problem with a library before, and I could solve it by changing some build path settings and restarting Eclipse. However, this just doesn't work for me any more. I hope anybody has another solution or an idea, I have no clue what's wrong...
Thank you all in advance!
Yeehaw
Edit:
Despite creating a whole new project and adding my previous files to this new project, I still had the same problem in the new project. I think I figured out where this error came from: When I added my external library, I still had dependencies from the just added .jar to other jars. After adding those as well, the compiler said I needed the java.rmi.Remote class, which is in Java's JRE system library (rt.jar). Adding the whole jre library to my project made the compiler error disappear, the runtime error, however, still persisted.
After some more research I found out that my external library is probably not compatible with the android runtime environment, which means that the jar's .class-files don't have an equivalent .dex-representation which is neededfor the Dalvik virtualmachine on android powered devices. For many java jar's, especially those designed for use with the android platform, those problems don't occur.
Please correct me if I'm wrong, but this explanation seemed pretty plausible to me. Too bad, since this is the only way to currently access our database programmatically.
Make sure you've updated to the latest version of ADT Eclipse plugin and SDK Tools and also make sure "Android Dependencies" is checked in your project properties.
I am getting ViewPager.PageTransformer cannot be resolved to a type I have updated the sdk to the latest and have the latest version of android-support-v4 in my libs folder and i read this post ViewPager.PageTransformer showing error ViewPager cant rersolved to a type i am using androidsupportv4 jar revision 9 and did the same steps but it didn't work.
You should remove ViewPager. from the begginging of declaration.
So, that would looks like just PageTransformer
Plus, import android.support.v4.view.ViewPager.PageTransformer;
that worked perfect for me.
Okay, I found the solution. You need to update your Android Support Library package. But if you have it now you need to uninstall it first then install it again in order to get new one.
If you have IntellijIdea:
Open SDK Manager window from "Tools/Android/SDK Manager"
Find Exteras folder then check Android support library. If its status is
installed click "Delete 1 package..." in order to delete it.
Check this package and click on install button.
Navigate to \extras\android\support\v4 then copy
android-support-v4.jar and paste it into your Libs folder.
Idea should recompile the project automatically, however if it didn't do
that then you should recompile it manually by click on
"Build/Rebuild Project"
That's it ;)
Realized I never answered this question. To solve this I grabbed the android-support-v4 from another computer and it worked. This could have the same effect as uninstalling and re-installing but i didn't try it.
At one point I had also found myself with the same issue. Apparently it is because whenever I decide to launch the Android SDK Manager within Eclipse I had been excluding an important step in the update process.
I always 'uncheck' the 'installed' option when trying to update. It was always my assumption that since the other checkmark labelled 'new/updates' would keep the updates visible to the installation. This actually is not the case though. Once I left 'installed' check-marked I saw updates from previously installed components. Then I was able to install the missing features that I thought were already up-to-date on my computer.
Hopefully, you find this helpful for getting the latest. It was misleading to me.
--Edit--
After getting the latest however, the post you referenced was what ended up resolving the issue for me however. I did not find a quick efficient way to sync with the latest version of the compatibility library. It is probably because on creation of the application it copies int he latest version locally into a project. So, you have to manually copy over the latest compatibility library.
Be sure to copy over the latest compatibility library however to all other supporting Android libraries that it also depends on as well. Otherwise you will get build errors with the new compatibility library in you local project settings.
You will need to get the Version 18 of the Android Support Library.
Make sure to update to that version using the SDK manager and then copy "android-support-v4.jar" and "android-support-v13.jar" to "libs" folders of your project.
That should take care of the issue.
Update your android support library from sdk manager.
Copy the android-support-v4.jar from \sdk\extras\android\support\v4 to your project's libs folder.
import android.support.v4.view.ViewPager.PageTransformer
Change ZoomOutPageTransformer implements ViewPager.PageTransformer to ZoomOutPageTransformer implements PageTransformer.
Thats it all errors will be gone and the animation works really well.
I added johannilsson-android-actionbar as a library to my project. It worked well, and everything was good for me. But recently, I have added the uitableView as a library and got this error:
/--mypath--/actionbar/res/values/attrs.xml:19: error: Attribute "tittle" has already been defined
And the R is not Known, so I cannot reference my XML. I have ADT 17 and Eclipse 3.7. I tried to remove the uitableview, and the project works fine, no Errors, and R is OK.
The authors of libraries need to take steps to avoid collisions on resource IDs. The authors of your libraries have not, apparently.
One possibility is to switch from johannilsson-android-actionbar to ActionBarSherlock and see if you have better luck.