Tuesday May 21, 2013

ADF Mobile - Deploying to Android fails with "Cannot find program ... aapt"

There's an old saying, if things don't change, they often stay the same.

It appears as of last week (post Google's I/O conference) that there has been a change to the Android SDK.  If you download the complete Android SDK as of 14th May 2013 and later, Google has changed the structure of the SDK such that some critical files that JDeveloper and ADF Mobile rely on deployment have moved.  The error during deployment you'll see is something similar to:

[08:36:21 AM] Shutting down Android Debug Bridge server... 
[08:36:21 AM] Deployment cancelled. 
[08:36:21 AM] ----  Deployment incomplete  ----. 
[08:36:21 AM] Cannot run program 
"/Users/joedoe/Oracle/adt-bundle-mac-x86_64-20130514/sdk/platform-tools/aapt": error=2, No such file or directory 
[08:36:21 AM] error=2, No such file or directory

In the SDK it appears the following files/directories have moved:

aapt
dx
/lib

...from...

<sdk>/platform-tools

...to...

<sdk>/build-tools/android-4.2.2 

...and it is this which causes the JDev ADF Mobile Android deployment process to choke.

For your reference Oracle is working on this and is tracking it via bug 16837655.  However there appears to be a simple workaround. Simply copy those files and the lib subdirectory to the platform-tools directory.  If the workaround does not work for you please log the issue on the OTN Forums and/or Support so we can investigate why.

Please note if you've downloaded the SDK prior to this, you wont hit this issue.  It only applies to anyone downloading the complete SDK since 14th May+.

Image courtesy of David Castillo Dominici / FreeDigitalPhotos.net

Thursday May 16, 2013

Migrating ADF Mobile apps from 1.0 to 1.1

I thought I'd share something valuable from ADF Mobile’s product manager Joe Huang. Within context of migrating ADF Mobile v1.0 11.1.2.3.0 applications to v1.1 11.1.2.4.0, there’s some important migration notes in the release notes that developers should read.

Of particular interest for myself is the change to how Javascript libraries need to be imported for the series of device integration videos I recently recorded. In ADF Mobile v1.0 you would have used the following JavaScript references:

<script type="text/javascript" src="../../../../www/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../../../www/js/adf.el.js"></script>
<script type="text/javascript" charset="utf-8" src="../../../../www/js/phonegap-1.0.0.js"></script>
<script type="text/javascript" src="../../../../www/js/adf.mf.device.integration.js"></script>

In ADF Mobile v1.1 you replace these with just the two following lines:

<script type="text/javascript">if (!window.adf) window.adf = {}; adf.wwwPath = "../../../../www/";</script>
<script type="text/javascript" src="../../../../www/js/base.js"> </script>

That's it - otherwise there are no other changes needed.

Please note, that if you need to invoke device services from a localHTML feature, you would still need to include cordova-2.2.0.js as well. In the previous version, due to some internal issues, PhoneGap1.0.0 always needed to be included even if you are only calling ADF Mobile related functions. In 11.1.2.4.0, only base.js needs to be included for ADF Mobile related functions, and cordova-2.2.0.js is needed only for device services integration like camera. And yes PhoneGap1.0.0 has been replaced with Cordova 2.2 in ADF Mobile 11.1.2.4.0.

Thanks very much to Joe for sharing this information.

Image courtesy of Vlado / FreeDigitalPhotos.net
About

Chris Muir - Oracle ADF Product Manager - The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« May 2013 »
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
22
23
24
25
26
27
28
29
30
31
 
       
Today