Unable to resolve errors on sliding menu example with actionbarsherlock - android

Hi I am a newbie to android and I am trying to run the Sliding Menu Example but i am getting so much errors
I have downloaded the package from here:
http://github.com/jfeinstein10/SlidingMenu/
and setup the actionbarsherlock
Also followed the instructions listed over here: http://boroniatechnologies.com/installing-slidingmenu-android-library-and-example/
and i am getting the following errors:
I am using Eclipse 22.0.0 and recent version of Android SDK

try this...
add actionbarsherlock library to slidingmenu library
in your project libraries, use only sliding menu library, not
actionbarsherlock.
delete the android support library in libs
folder in slidingmenu library, and in libs folder in your project
and clean all projects, and try it.

If you have updated SDK means,
select project->right click->go to properties->order and export>select Android Private Libraries. Click Ok.
Clean the project and run it.

The usual suspect for such errors is the minSdk/targetSdkVersion of your Android project. Try minSdkVersion of 7 and targetSdkVersion 17 (latest as of now). That is, your AndroidManifest.xml should be having this line
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="17" />
And also, from project properties, set Android 4.2 (latest as of now) as the target. Project properties -> Android -> target:4.2
That should solve it. But, if you are still getting errors (on account of different versions of SlidingMenu), experiment with higher minSdkVersion.

Related

App compact v7 error

I am trying to modify my code to include the latest nav drawer as seen in Google play stand. For this the first step is to add the app compact v7 to my project. I first updated my SDK and then imported the library project. It threw some errors, I gooogled and set the version to 21 in Project properties. The errors were resolved.
Now when I try to add this to my project by importing the library I get all sort of resource not found errors. I am clueless as only after adding the app compact v7 to my project as a lib I get these errors what can be possibly wrong here?
I am following steps exactly as defined here
Here is the screen shot without any errors on app compact v7:
Right click on project --> Go to properties --> Go to Android --> Set Project Build Target as Android 5.0 or 5.0.1 --> Apply......Hope this will solve your problem

resolving appcompat_v7 error

I am having a issue regarding the resolving of appcompat_v7...As mentioned on many answers i imported the jar file from the \sdk\extras\android\support\v7\appcompat\libs...
but the problem is under properties->android i am getting a red cross next to appcompat_v7
as mentioned on various answers i then clicked on add button here...but i get no library name
the library is installed as the import is working properly as can be seen here the import shows no error..but my style.xml file in the res folder is showing the following error
can somebody please tel me what i am doing wrong here..
also my SDK manager shows that my android support library is installed...
I am just new to android and cant figure out what I am doing wrong here..
You dont import jar's from the appcompact-v7 library. You import the library itself in your workspace. Then you add the library into your project. In your project you can remove the appcompact-v7 in red and add it again. That should solve the issue.
Note also that:
You must have the latest versions of SDK Tools / Build Tools / Platform Tools. If you try this and it doesn't work, then go to the Android SDK Manager and make sure you have the latest versions of the required tools.
In case your project only requires API level 14 (Ice Cream Sandwich) & above, select API level 14 for "minimum required SDK" in the project wizard when you create a new project. Now the appcompat_v7 library will not be required for this project, and the application will use the native ActionBar class which is present in AOSP builds from ICS onwards.

Unresolved dependency error when creating a new project

This error appears when creating a new Android Application module in Android Studio using Fixed Tabs + Swipes for navigation.
It says:
The following dependencies were not resolvable. See your build.gradle
file for details. - com.android.support:appcompat-v7:18.0.0
I'm targeting Android 4.0+ devices. Why is the compatibility library involved? One workaround is to install this library using the Android SDK manager, but I'm concerned my app will actually use this compatibility library when there is no reason to. The ActionBar and fixed tab navigation should be built-in to the Android 4.0+ framework right?
This happened to me with IntelliJ Idea 13 Ultimate when creating new Gradle Module. I was working on the app that supports Froyo. I had to manually add support libraries to the SDK. After that I was able to build just fine. Here is the screenshot of Project Structure settings for SDK that I have:
As you can see, support for v4, v7 and v13 which were added manually. Those will be associated with Android API 19 Platform (in my case). When you create next new Gradle Module, you will still need to go to Project Structure to select the SDK under Project, but you will not need to add support libs again. Hope this helps.
I installed the compatibility library anyways. Something I didn't realize is that you can't create your first module by using File -> New Module. You have to use File -> Project Structure -> New Module for your first module. It's really unintuitive. After I did this, then everything worked.

Android library project Sliding Menu throws java.lang.NoClassDefFoundError: com.slidingmenu.lib.R$styleable

I'm developing an android application and I'm trying to use a library Sliding Menu (github.com/jfeinstein10/SlidingMenu). However, I have a problem in using the library in a clean project. I get
java.lang.NoClassDefFoundError: com.slidingmenu.lib.R$styleable
when doing
SlidingMenu slidingMenu = new SlidingMenu();
Configurations tested:
JDK tested 1.6u43, 1.7(latest)
Project target api = tried both Android 4.2.2 and Google API 17
SDK versions tested 21, 21.0.1, 21.1
Windows 8 Pro x64, Intel Core i7 3610QM, Nvidia GT660M, Samsung Pro 840 256GB SSD
Integrated both with Actionbarsherlock and without it.
I import the library, by creating an Android Project from Existing Code, marking "Is Library" in the android properties, and then referrencing it in the original application android properties (not via .jar)
Below links to code snippets, full stacktrace and screenshots of current configurations
Code snippet:
http://pastebin.com/2yzRC5AJ
Full Stacktrace:
http://pastebin.com/D7RQwuQd
I've been stuck on this for 3 days now... :/
I had to add the dependency two ways before I eradicated my noclassdef errors
Add the library.jar from /bin as dependency to your build path, make sure to select the Order and Export tab and select the check box as well for the new dependency.
Add the library via right mouse click on your project, then properties, then android then add library
Voilla
I struggled with this as well, and from a vast number of google searches, managed to piece this together.
Hope it helps..
Simple solution :
If your project already contain support library then just delete support library from library(jfeinstein10 / SlidingMenu) and then every thing works fine.you can do it after import also.
1) Just add the library to the properties of your project (ANDROID);
2) And mark the same in Order & Export property of (JAVA BUILD PATH);
I had the same problem. Since you're building the app with IDE, you need to tell the IDE that this module is a Library, thus defining the library in .properties file would be useless. Try change the IDE build file, I'm not familiar with eclipse, but in android studio this lines would be enough:
module.iml
<configuration>
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
Go to Manifast and change sdkversion to 11

ActionBarSherlock not working in eclipse

I have been trying to get ActionBarSherlock ( http://www.actionbarsherlock.com ) working with my eclipse projects. I added ABS into a new project with target version 3.2, and this created fine. When I try to add this as a library to my other project (min version 2.1, target 3.2), I get errors such as
G:\EclipseWorkspace\Android\ActionBarSherlock2\res\values-v11\abs__styles.xml:65: error: Error: No resource found that matches the given name: attr 'android:windowActionModeOverlay'
basically, none of the xml attributes found in 3.0 or higher are recognised. As a consequence, R.java does not generate.
Am I doing anything wrong?
You need to compile with Android 3.2 in addition to targeting at least API 11 both in your app and for the library.
In eclipse, right click on the project and go to "Properties". Under the "Android" tab you'll need to select Android 3.2.
Eclipse is giving me strange Errors too, when implementing external libraries. What always helped for me after some tries:
try multiple times:
*rightclick on your project => Source => Clean Up
*delete and readd the library project
*restart eclipse several
you might also try to delete the generated files to force it to regenerate, but do this on your own risk :)
have fun w/ the open source libraries :)
Try upgrading the version of the sdk and target version 2.1:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
This will allow using last sdk features and the app will work on version 2.1.
Maybe, you'll see issues even after fixing this. Then you can clean the project.

Categories

Resources