1. Ti Studio update to latest Java Development Tool (JDT) yet?
2. does Android SDK version is supported by current Ti Studio?
3. is Android NDK up to date?
Scenario:
After upgrade Ti Studio, previously successfully packaged Android Module can no longer to package successfully.
Problem:
1. a red-cross icon appear next to the project in the Project Explorer.
2. the following error arise when select Package:
Error with Debug UI: Java.lang.reflect.InvocationTargetException
3. Build fail with error:
BUILD FAILED /Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/module/android/build.xml:326: The following error occurred while executing this line: /Library/Application Support/Titanium/mobilesdk/osx/3.4.1.GA/module/android/build.xml:281: Execute failed: java.io.IOException: Cannot run program "/ndk-build" (in directory "/var/folders/v8/tw7vf7t51ms_hdgf7blzr1t40000gn/T/etp_user/titanium-module-extended-webview-android-generated"): error=2, No such file or directory
3. Build success but in target project, it said "requested module not found"
Ref: https://developer.appcelerator.com/question/179241/-please-help-someone-from-appcelerator--fail-to-package-android-module
[Problem 1] Root cause:
"Debug UI" error is due to unsupported Android SDK is used. SDK 20 is not supported by Ti Studio 3.4.1.GA
Solution:
1. check Ti Studio release note and ensure installed Android SDK version is supported.
2. installed Android SDK if necessary.
3. Modify SDK path in project's build.properties file and build path
4. Modify SKD path in Ti Studio Preference > Studio > Platforms > Andriod
[Problem 2] Root cause:
the red-cross icon is due to outdated JDK.
Solution:
First of all, check whether JDT is installed. Simple checking: Create new module project. It will prompt you to install JDT if not yet installed.
After upgrade to Ti Studio, Eclipse JDT (Java Development Tool) need to be update as well.
Note: Software update repository varies with the version of Ti Studio
Appcelerator/Titanium Studio Version
|
Eclipse Repository Name
|
Eclipse Version
|
|---|---|---|
| 2.1.x | Helios | 3.6 |
| 3.0.x - 3.1.3 | Indigo | 3.7 |
| 3.1.4 - 3.4.x | Kepler | 4.3 |
| 4.0.0 - latest | Luna | 4.4 |
Steps to update JDT:
1. Select Help > Install New Software
2. Select corresponding repository site according to the above table.
3. In the list, select Eclipse Java Development Tools, and install
Ref: http://docs.appcelerator.com/titanium/3.0/#!/guide/Installing_the_Java_Development_Tools
After update JDT, red-cross icon should disappear.
[Problem 3] Root cause:
NDK is not up to date.
Solution:
1. Download latest NDK from Android website
2. Open terminal to chmod a+x of downloaded file (.bin)
3. execute to extract
4. copy the extracted folder to desired location
5. Set path in Ti Studio Preference > Studio > Platforms > Android ,
as well as Preference > Android > NDK
[Problem 4] Root cause:
The module name specified in build.xml does not match that declared in the main Module class.
e.g. In Module class:
@Kroll.module(name="compression", id="ti.compression")
Then in build.xml, project name should declared as:
<project name="compression" default="dist">
Solution:
Check target project's module folder to make sure Module jar file exist in version folder
i.e. ~/projectDir/modules/android/ti.compression/2.0.3
沒有留言:
張貼留言