Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13634] CLI: Reading Android add-on fails if missing manifest.ini file

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-05T21:06:07.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 12 JS, 2013 Sprint 12, Release 3.2.0
ComponentsCLI
Labelsqe-closed-3.2.0
ReporterChris Barber
AssigneeChris Barber
Created2013-04-19T22:31:06.000+0000
Updated2013-11-20T01:42:25.000+0000

Description

The CLI dies when an add-on doesn't have a manifest.ini:
[ERROR] Application Installer abnormal process termination. Process exit value was 1
c:\Users\Johnny\AppData\Roaming\npm\node_modules\titanium\node_modules\longjohn\dist\longjohn.js:181
        throw e;
              ^
Error: ENOENT, no such file or directory 'C:\Android\add-ons\android-ndk-r7\manifest.ini'
    at fs.openSync (fs.js:338:18)
    at fs.readFileSync (fs.js:182:15)
    at exports.detect.async.series.targets (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\android.js:168:25)
    at exports.visitDirsSync (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\fs.js:99:3)
    at Array.forEach (native)
    at exports.visitDirsSync (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\fs.js:98:5)
    at exports.detect.async.series.cached (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\android.js:167:10)
    at exithandler (child_process.js:538:7)
    at EventEmitter.emit (events.js:99:17)
---------------------------------------------
    at exports.execFile (child_process.js:594:9)
    at exports.exec (child_process.js:481:18)
    at exports.detect.async.series.cached (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\android.js:81:4)
    at async.series.results (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:486:21)
    at _asyncMap (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:185:13)
    at async.forEachSeries.iterate (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:108:13)
    at async.forEachSeries.iterate (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:119:25)
    at _asyncMap (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:187:17)
---------------------------------------------
    at exports.execFile (child_process.js:594:9)
    at exports.exec (child_process.js:481:18)
    at exports.detect.async.series.exec.cwd (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\node-appc\lib\android.js:68:4)
    at async.series.results (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:486:21)
    at _asyncMap (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:185:13)
    at async.forEachSeries.iterate (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:108:13)
    at async.forEachSeries.iterate (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:119:25)
    at _asyncMap (C:\Users\Johnny\AppData\Roaming\Titanium\mobilesdk\win32\3.1.0.v20130409124549\node_modules\async\lib\async.js:187:17)
The fix is trivial, we just need to check that the manifest.ini exists:
// Create the list of target directories and their properties
afs.visitDirsSync(path.join(sdkPath, 'add-ons'), function(subDir, subDirPath) {
	var manifestFile = path.join(subDirPath, 'manifest.ini');
	if (afs.exists(manifestFile)) {
		var manifest = fs.readFileSync(manifestFile).toString();
		targetDirs.push({
			dirPath: subDirPath,
			name: manifest.match(manifestNameRegex)[1],
			vendor: manifest.match(manifestVendorRegex)[1],
			api: manifest.match(manifestApiRegex)[1],
			revision: manifest.match(manifestRevisionRegex)[1]
		});
	}
});
Related Q&A question: http://developer.appcelerator.com/question/151052/cant-build-project-after-studio-update

Comments

  1. Chris Barber 2013-06-05

    Node-appc master pull request: https://github.com/appcelerator/node-appc/pull/49
  2. Chris Barber 2013-06-05

    To test, locate your android-sdk installation, then go into the "addons" directory. Next select any addon folder and rename the "manifest.ini" file in it to "manifest2.ini" (or whatever). Run "titanium info" and watch the crash.
  3. Olga Romero 2013-11-20

    Followed test steps and got
       !  The Android emulator "4.1.2_Android_API16" has a problem: Unknown target 'Google Inc.:Google
            APIs:16' in /Users/oromero/.android/avd/4.1.2_Android_API16.ini
       
    Environment CLI 3.2.0-alpha

JSON Source