Project: titanium
Issue TIMOB-6860: Tooling: Android build process requires "Google APIs" even if "Ti.Map.createView" only occurs in comments
h2. Problem For a Titanium mobile project on Android, if Titanium sees that you're using a Ti.Map.createView in your project, running on the emulator will fail unless your run configuration indicates use of one of the "Google APIs" Android API. I assume it is scanning the source js files for this. That's fine. The problem is that if the only place you have the text "Ti.Map.createView" is in a comment (// comment), Titanium does the same thing, and fails to install with the message, {{Package com.testing.testing9 requires unavailable shared library com.google.android.maps; failing!}}. I have to think that there are other things like that too. Titanium's build process should not detect things like this that are in comments, thus triggering the "Google APIs" requirement. I do not know if this affects iOS as well. h2. Test case {code:lang=javascript|title=app.js} var win = Ti.UI.createWindow({ layout:'vertical', exitOnClose:true, navBarHidden:true }); var label = Ti.UI.createLabel({ color:'white', text:'Hello World', width:'auto' }); win.add(label); // some day add a Ti.Map.createView to this win.open(); {code} h2. Logs {code} 403 AndroidRuntime D >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< 403 AndroidRuntime D CheckJNI is ON 403 AndroidRuntime D --- registering native functions --- 87 PackageParser D Scanning package: /data/app/vmdl28961.tmp 87 PackageManager D Scanning package com.testing.testing9 87 PackageManager E Package com.testing.testing9 requires unavailable shared library com.google.android.maps; failing! 87 PackageManager W Package couldn't be installed in /data/app/com.testing.testing9-1.apk 403 AndroidRuntime D Shutting down VM 403 AndroidRuntime I NOTE: attach of thread 'Binder Thread #3' failed {code}
Story points: 3