Android :: Eclipse Not Importing Jar Dependencies Between Two Projects
Jun 7, 2010
Here is the situation.
I have a java project "LicenseGenerator" in eclipse that depends on commons-codec. I have therefore added the commons-codec jar file to the build path. I have Junit tests and everything is working fine. I have made a different project in the same workspace - which happens to be an Android project - that needs to use my LicenseGenerator classes. I added LicenseGenerator to the "projects" tab in the build path - the classes were recognized and I was able to use them.
Everything compiled and ran. However, when the part of the LicenseGenerator that used the commons-codec was called from my Android project I got the following error.
Could not find method
org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString,
Referenced from method
This basically tells me that the commons-codec was not packaged which the Android project, so I added the commons-codec to the android project as well but the same error appears.
View 2 Replies
Mar 10, 2010
I always face this problem in my eclipse. I would like have a copy of the apps in all the versions of SDKs/NDKs. And once I have a project in eclipse, and if I have to import the same project from a new location, I get the message saying "Can't import, project of the same name already exists". Is this how it is? We cant import the same project from its 2nd location in eclipse? Everytime I delete the project from old location and put it in new. I know, it is a very unacceptable approach).
View 2 Replies
View Related
Feb 21, 2009
I have two Android projects, a 'library project' containing a custom layout, and an 'application project' containing an application which uses the layout. Everything seems to build and execute fine, except that the visual layout editor throws a ClassNotFoundException (which I assume is a bug in the plug-in), but when I try to start to make use of the attributes I defined for the custom layout in the xml, the build fails. That is; this works:
<?xml version="1.0" encoding="utf-8"?>
<se.fnord.android.layout.PredicateLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdfasdf" />
</se.fnord.android.layout.PredicateLayout>
Whereas this does not:
<?xml version="1.0" encoding="utf-8"?>
<se.fnord.android.layout.PredicateLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fnord="http://schemas.android.com/apk/res/se.fnord.android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView fnord:layout_horizontalSpacing="1px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdfasdf"/>
</se.fnord.android.layout.PredicateLayout>
The build fails with a message from aapt:
ERROR No resource identifier found for attribute
'layout_horizontalSpacing' in package 'se.fnord.android'
The resource identifier does exist in the R-file and attrs.xml contained the library project, and if I put the layout code and resources directly in the application project everything works fine. The layout_horizontalSpacing attribute (and layout_verticalSpacing) is a custom attribute used in the PredicateLayout.LayoutParam class to specify the distance to the next widget. So far I've tried the standard eclipse ways by specifying project references and build path project dependencies. I was also told to try the <uses-library> tag in the application manifest, which did not help.
So, what do I need to do for the references in the xml-file to work? I don't know if it's relevant, but the 'library' manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.fnord.android" android:versionCode="1" android:versionName="1.0.0">
</manifest>
The 'application' manifest like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.fnord.appname"
android:versionCode="1" android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".AppName"
android:label="@string/app_name">
<intent-filter> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent filter> </activity> </application> </manifest>
'se.fnord.android.layout.PredicateLayout', btw, is a cleaned-up
Version of the layout posted at http://stackoverflow.com/questions/549451
View 5 Replies
View Related
Feb 21, 2009
I have two Android projects, a 'library project' containing a custom layout, and an 'application project' containing an application which uses the layout. Everything seems to build and execute fine, except that the visual layout editor throws a ClassNotFoundException (which I assume is a bug in the plug-in), but when I try to start to make use of the attributes I defined for the custom layout in the xml, the build fails. That is; this works:
<?xml version="1.0" encoding="utf-8"?>
<se.fnord.android.layout.PredicateLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdfasdf" />
</se.fnord.android.layout.PredicateLayout>
Whereas this does not:
<?xml version="1.0" encoding="utf-8"?>
<se.fnord.android.layout.PredicateLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fnord="http://schemas.android.com/apk/res/se.fnord.android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView fnord:layout_horizontalSpacing="1px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="asdfasdf"/>
</se.fnord.android.layout.PredicateLayout>
The build fails with a message from aapt:
ERROR No resource identifier found for attribute
'layout_horizontalSpacing' in package 'se.fnord.android'
The resource identifier does exist in the R-file and attrs.xml contained the library project, and if I put the layout code and resources directly in the application project everything works fine. The layout_horizontalSpacing attribute (and layout_verticalSpacing) is a custom attribute used in the PredicateLayout.LayoutParam class to specify the distance to the next widget. So far I've tried the standard eclipse ways by specifying project references and build path project dependencies. I was also told to try the <uses-library> tag in the application manifest, which did not help.
So, what do I need to do for the references in the xml-file to work? I don't know if it's relevant, but the 'library' manifest looks like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.fnord.android" android:versionCode="1" android:versionName="1.0.0">
</manifest>
The 'application' manifest like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="se.fnord.appname"
android:versionCode="1" android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".AppName"
android:label="@string/app_name">
<intent-filter> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent filter> </activity> </application> </manifest>
'se.fnord.android.layout.PredicateLayout', btw, is a cleaned-up
Version of the layout posted at http://stackoverflow.com/questions/549451
View 2 Replies
View Related
Jul 7, 2010
I generated a standard Android under Eclipse (using the plugin) and I imported code from an existing project (J2SE-based). I was able to iron out all the complaints from the Android SDK 2.1 (compile errors). However, the runtime (emulator startup) the IDE displays a message saying that the project contains errors, please fix them before running it. But all that there is there are warnings - is Android "unforgiving" about Java warnings or is there something else I should be looking into in there - no class has any compile errors.
View 13 Replies
View Related
Nov 11, 2009
Does anyone know of suggestions/recommendations on how to structure Eclipse projects in order to build an apk from multiple projects? I would like to share classes & resources (strings, layouts, etc.) across multiple apps. How to structure Eclipse projects to do such a thing!
View 8 Replies
View Related
Mar 16, 2010
I have problems with the following: I want to create to applications. One with a Android service and one with a Activity that will use functions on the Service. Before I splitted this in to applications I got everything working in one application. I can call functions (that are definned in the aidl - file) on the service without problems.
Now the problems coms. I splitted the application into two parts, a Service application and Gui application. The bindins to the service (in the gui application) works and I see that the service is getting created. Then in the onServiceConnected function of the ServiceConnection class I created the following:
mService = IMyService.Stub.asInterface(service);
And this gives me the following exception:
03-16 13:53:05.549: ERROR/AndroidRuntime(881): java.lang.NoClassDefFoundError: MyPackage.IMyService$Stub
It looks like he can't find the Stub class in IMyService. But the Stub is part of the java file generated out of the aidl-file. Why I get this exception or how I can resolve this?
View 9 Replies
View Related
Jan 12, 2010
I have a library-only Android eclipse project (no main class, only library classes) that I want to include in my main Android Application project. I went to the Build Path and added the library project to the "Required projects on the build path" on the Projects tab, and checked it on the "Order and Export" tab. However, when the application is run, it emits VerifyError exception, because the class from the library project didn't happen to be packaged together in the apk.
View 1 Replies
View Related
Apr 27, 2009
how to import the Android Default projects into our Eclipse. E.g androidsourcerootpackagesappsAlarmClock. I want to import this project to my eclipse work space, I tried with import projects and open excisting Android Projects. But that two are not working.
View 5 Replies
View Related
Jan 19, 2009
For some unknown reason when I now try to create a new Android project in Eclipse (Ganymede running on Windows) it fails to link to the android.jar in the SDK (1.0_r1). This has never happened before, and all my existing projects continue to resolve Android components just fine.
Error: "Cannot create linked resource '/.org.eclipse.jdt.core.external.folders/.link0'. The parent resource is not accessible."
View 2 Replies
View Related
Jul 6, 2010
How can I attach Java source to an Android project? I'm able to browse java source for a Java project, but not for an Android project. I modified project properties and add Java source in "Libraries" section, still not working.
View 1 Replies
View Related
Jul 27, 2010
I have 2 android applications that share 95% of their resources, layouts, strings etc. only a few jpg's are different.
How can I share resources between the different Eclipse Android projects, so as to avoid resource duplication ?
View 2 Replies
View Related
Sep 13, 2009
I have notices following:
If I have a project with minimum files in res folder, the project saves quickly, compiles quickly and launches quickly. But if I have a lot of resources, my project is saving, compiling and launching during relatively long period of time. This is really frustrating if you do some minor UI updates, and you have always wait Eclipse to generate R file etc.
View 1 Replies
View Related
Jun 14, 2009
When I make a new project the .java file is not generated. I can run the project, but it does not run in the emulator or anything. It did use to work before then it stop working. I tried deleting the folder and all project files. After that I reinstalled everything but I am still having problems.
View 3 Replies
View Related
Jul 27, 2009
I'm working on two projects. One is essentially a library, and the other is an application using that library. Now from the application project, I want to use the library's classes, so I added that project to the "required projects" under java build path. It seems to compile fine, but at runtime, I get this error:
07-27 11:26:57.037: ERROR/dalvikvm(741): Could not find class 'interdroid.contextframework.ContextManager', referenced from method com.bartvanwissen.contextframeworktest.MainActivity.onCreate
Apparently, the library project's classes are not added to the apk file. How can I make sure they are included? Since I'm working on both projects at the same time, I would like to prevent having to create a jar file every time I want to test something.
View 4 Replies
View Related
Mar 12, 2010
As you know, you can't have capital letters in your image filenames that you use in your Android project (Ressource/Drawables folder). I've got hundreds of small images (GOOG.GIF as an exemple) that I need to import into my project (I usually do a simple drag and drop from a desktop folder into Eclipse).How do I quickly change all the filenames (replace all capital letters to lower case) before importing into my project?
View 3 Replies
View Related
Mar 24, 2010
An Android Java project placed in a git repository and built in an Android tree in /packages/apps needs to have the project files located at the root of the git repository.This is problematic for creating a complementary Test project, which should ideally be included in the same git repository so commits are atomic for both code and tests. Eclipse gets very unhappy if you include the Test project as a subdirectory.Is there an appropriate approach for dealing with this other than creating a second repository?
View 2 Replies
View Related
Jun 14, 2010
I just started to play with android dev and java+eclipse is pretty new to me. I managed to create simple project and run it on my device. Now I want to create simple game (more of them actually) and I would love to use shared code base for all of them (game loop, initialization, etc..). Problem is that I have no idea how to correctly do this. I created android project called engine with all basic stuff that I need and made it work on device. Now I tried to create another project in same workspace called mygame. Main class (activity) of mygame is MyGameApp which inherits from EngineApp (main activity of my engine project) which inherits from Activity. I added engine project into required projects in mygame build path tab in properties. Problem is that when I try to run this project it crashes on ClassNotFoundException trying to find my MyGameApp class.
View 1 Replies
View Related
Jun 17, 2010
Every time I try to run an Android project from Eclipse with the Android plugin (Run -> Run), the emulator starts up just fine, but the upload fails, and the Console puts out this error message:
[2010-06-17 08:17:55 - HelloAndroid] Failed to upload HelloAndroid.apk on device 'emulator-5554'
[2010-06-17 08:17:55 - HelloAndroid] java.io.IOException: Unable to upload file: Local file doesn't exist.
[2010-06-17 08:17:55 - HelloAndroid] Launch canceled!
It seems as though the apk compilation is failing, but there are no other errors in the Console at all except for a lone warning about the project not specifying an API Level requirement:
[2010-06-17 08:17:55 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-06-17 08:17:55 - HelloAndroid] Device API version is 8 (Android 2.2)
View 3 Replies
View Related
Feb 9, 2010
I'm trying to import and existing Android project into my current Eclipse workspace. I select File->New->Android Project, which brings up the Android project dialog, I then select, "Create project from existing source", Location, Build Target and Finish. I get the following error: Invalid project description. Does anybody know how to get past this error?
View 2 Replies
View Related
Nov 2, 2010
I reinstalled my computer and tried now to import my Android project into the workspace.
(File -> Import -> General -> Existing Project into Workspace)
But now I have got a strange error.
CODE:..........
In the second line (@Override) eclipse always tells me there is an error:
CODE:............
This happens everywhere, where @Override is used.
I already tried to Android-Tools -> Fix Project Settings and Project -> Clean.
View 2 Replies
View Related
Mar 29, 2010
I resolved this issue myself. It turns out that the activation framework requires some libraries that aren't native to android, myjava.awt.datatransfer, org.apache.harmony.awt.*, and org.apache.harmony.misc. Once i added those libraries everything worked fine. Code...
View 2 Replies
View Related
Nov 8, 2009
I've been reading how to get more memory thread where is suggested to run clearapps.sh script in order to remove unnecesarry applications on a great Galaxo ROM. I was wondering, is it possible that MarketEnabler depends on some of those apps, because after running the script, it fails to either restore settings from backup or set different provider. There is no force-close or freeze. It just pops up "working" box for indefinite time period without progres bar filling (I waited several minutes). The infobox can be easily discarded with the back button.
View 1 Replies
View Related
Mar 30, 2010
I seperate my application into 2 projects. one for UI,the other is for service.How can I build these 2 applications into one apk?
View 9 Replies
View Related
May 5, 2009
I have 2 projects in the following layout
MainActivityProject -> BaseProject
(i.e. MainActivityProject depends on the other project). Both are android projects created with the eclipse "New Android project functionality) however, the BaseProject does not have an activity defined. However, in BaseProject I define an activity base class where MainActivityProject's Activity derives from. This used to work fine up until 1.1 but now with the 1.5 SDK I get ClassNotFoundExceptions when launching the app.
Any suggestion on how to fix this? I obviously dont want to copy all the sources to a single project as I intend to reuse my Activity base class for other things (it contains some boiler plate stuff that I dont want to have in each and every activity.
View 3 Replies
View Related
Oct 23, 2010
I have several projects which contain the same strings. Is there a way to share the strings.xml file between projects? I have a library project where I put shared .java code which has a strings.xml, but is the data in the library strings.xml added to the including project's strings.xml at build time?
View 2 Replies
View Related
Oct 8, 2009
My application is seperated into three projects in eclipse. The first one is a client Android Project called "Project A". The second is a server Android Project called "ProjectB". Lastly, I have "ProjectATest" for testing that has references dependencies to "ProjectA" and "ProjectB".
When excuting InstrumentationTestRunner in "ProjectATest," I get the following error message:
CODE:.........
This is the error as pulled from LogCat:
CODE:......................
View 5 Replies
View Related
Jun 1, 2010
Just got the incredible and I need an app that will help me with work because that's the main reason I got a smartphone. I use to use Google Apps spreadsheets to keep track of all my writers projects, but it seems that would be harder on the incredible. Basically I need something where I can know which client the project is for, which writers are working on it, a short description of the project, if it's done, been paid for, etc. Any app that could help me with this?
View 1 Replies
View Related
Jul 8, 2010
Having custom attribute (in attrs.xml) in library project leads to compilation fail of the project dependent of that library.Code...
How to avoid this except for no having custom attributes in library?
View 7 Replies
View Related
Jun 17, 2010
I am trying to import projects from a book "Beginning Android 2" but when I choose the root directory the "Finish" button is still grayed out. I've tried importing the project from scratch with no success, and I've also tried to create a template project with the same name and everything and then importing into that (Import existing projects into workspace) but it always says "No projects are found to import".
The contents of the folder are: Res folder, src folder with .java file, the manifest, build, and default.properties files.
View 1 Replies
View Related