Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Thursday, January 27, 2011

Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.

So as the title says, this is the error I got when compiling a project I build for about a year ago.

Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.

Cause:
In strings.xml I had the following format arguments "%s/%s"
ex. <string name="template_user_agent">"%s/%s (Linux; Android)"</string>

Now, format arguments had to be changed to "%1$s/%2$s"

Then, the error should dissapear.

I found the solution from the following pages.


http://stackoverflow.com/questions/4437023/resources-ap-does-not-exist-when-compile-my-android-project

http://developer.android.com/guide/topics/resources/string-resource.html

http://mobile.tutsplus.com/tutorials/android/android-sdk-format-strings/

Tuesday, December 21, 2010

SVN client for Eclipse

So I've again started developing android apps seriously.
I haven't used SVN since I moved into Mac OS X.

I'm using Eclipse Helios(Eclipse 3.6) now.
I've decided to go ahead with subclipse svn client since I've used it before.
To install it, go to Help => Eclipse Marketplace...
Then, search for Subclipse, I'm sure you'll find it there.


Here's the subclipse page just for reference.
http://marketplace.eclipse.org/content/subclipse

Ok, here's further notes on how to use svn on Mac OS.
When I tried to upload my source code, it didn't work.
Basically I was missing svn....yes, very embarassing.
So I downloaded and installed MacPorts using binary edition.
Then, I did self update using the following command.
sudo port -v selfupdate

Then, I installed svn client using the following command.
sudo port install subversion

Even after that, I couldn't use subclipse.
I kept on getting some weired JavaHL errors and couldn't proceed to share my project using svn.
The solution was right in subclips wiki page.
http://subclipse.tigris.org/wiki/JavaHL

Basically, I downloaded and installed the OSX package that is provided on openCollabNet.
Then, I modified .profile, just adding one liner (export PATH=/opt/subversion/bin:$PATH) just as instructed on the completion page of the svn installer.

Now, I can finally get down to coding and sharing the project!!! YEAH!!!

Sunday, November 14, 2010

Android: dealing with "Unable to open class file R.java" error

Here's another common error on Eclipse environment.
Unable to open class file R.java
I googled for solutions, there were many varieties but none worked so far.
But for me, the solution was very plain simple.

Go to Menu -> Project -> Clean

That solved the issue for me.
To all Android enthusiasts.

Android: dealing with debug certificate expired error

I haven't done any Android development recently.
I've been busy playing with new iPad and iPhone4.
But I'm an Android enthusiast at heart. Today I've gone back into developing Android apps.
However, I got stuck with a couple of problems before I could actually start developing again.
After updating all the SDKs, I got this error "debug certificate expired".

The solution was right in the developer page.
To fix this problem, simply delete the debug.keystore file. The default storage location for AVDs is in ~/.android/avd on OS X and Linux, in C:\Documents and Settings\\.android\ on Windows XP, and in C:\Users\\.android\ on Windows Vista.
Signing Your Applications



My problem was fixed.
My coworker however couldn't find the debug.keystore file.
I found this section "I can't compile my app because the build tools generated an expired debug certificate" in the trouble shooting page.


Here's the quotes from the page.
  1. First, delete the debug keystore/key already generated by the Android build tools. Specifically, delete the debug.keystore file. On Linux/Mac OSX, the file is stored in ~/.android. On Windows XP, the file is stored in C:\Documents and Settings\<user>\.android. On Windows Vista, the file is stored in C:\Users\<user>\.android
  2. Next, you can either
    • Temporarily change your development machine's locale (date and time) to one that uses a Gregorian calendar, for example, United States. Once the locale is changed, use the Android build tools to compile and install your app. The build tools will regenerate a new keystore and debug key with valid dates. Once the new debug key is generated, you can reset your development machine to the original locale.
    • Alternatively, if you do not want to change your machine's locale settings, you can generate the keystore/key on any machine using the Gregorian calendar, then copy the debug.keystore file from that computer to the proper location on your development machine.

     
Basically, she had to change the locale, and restart the computer.
Then her development environment started working as well.
To all Android enthusiasts.