Expectations
Required permissions for Ti modules to be inserted into androidManifest.xml on build
Reality
Required permissions are NOT being inserted into androidManifest.xml on build.
Replicate
Throw Ti.Media.vibrate into any project, build, check generated androidManifest, fail to find permission.
Expect to find:
<uses-permission android:name="android.permission.VIBRATE"/>
Current Workaround
add require permission manually to tiapp.xml
Note: this is a regression, but I'm not sure when it last worked. Not a function we use on a regular basis.
Hello, We tested this issue with the code bellow. We can't reproduce this problem in latest release. Please try this sample code and let us know if the issue persists. If you use a different test case, please post it here.
Testing Environment:
Android SDK: 4.2.2 Titanium SDK: 3.2.0.GA, 3.3.0.v20131220192449 Titanium CLI Version: 3.2.0Test Code
Steps to Test:
1. Create a sample project, 2. Paste this code in app.js file. 3. Run this with testing environment. 4. Click on press buttonActual/expected result
Vibration working without modify androidManifest fileBlah, beyond caring any more. When quality, knowledgable first tier folks start processing tickets, I might start resubmitting. http://stackoverflow.com/questions/13159386/android-does-notification-default-vibrate-require-vibrate-permission
Perhaps this is a larger issue? It seems for some folks the camera permission is no longer being added automatically. http://developer.appcelerator.com/question/161322/timediashowcamera-fails-on-genymotion-emulator-even-though-other-camera-apps-work-fine
Can confirm that camera permissions are not being copied over in either. Titanium Command-Line Interface, CLI version 3.2.0, Titanium SDK version 3.3.0.v20140106195650 Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
Without the permission, showCamera error callback fires, with the permission, camera launches. These permissions are not optional, despite what 'Rahman' seems to think.
Not the same issue, but perhaps there is a related component during the manifest generation: TIMOB-16088.
I gave this a test and could not reproduce. The only thing that could throw this off are: 1) if you have a custom AndroidManifest.xml 2) you did something like: var tim = Ti.Media; tim.vibrate(); 3) you put the Ti.Media.vibrate() call in a file that does NOT have a .js extension So, what am I missing?
Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh. It's an emulator only thang. Fix coming soon!
Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5196 3.2.x pull request: https://github.com/appcelerator/titanium_mobile/pull/5197 To test: 1. create a project for ios and android 2. add Ti.Media.vibrate(); to app.js 3. run: ti build -p android --build-only 4. look at build/android/AndroidManifest.xml and confirm it contains the android.permission.VIBRATE permission
[~cbarber] Additional comment from Stephen Feather: Permissions are not being generated for Ti proxy objects that DO require them. Additionally, in investigating the permissions issue for the end user, it appears that if an overlay is added to a camera proxy on android, the modules.titanium.media.tiCameraActivity class may not be being added to the androidManifest.xml either. Please make sure that your fix takes care of this scenario as well.
Test Environment: Appc-Studio: 3.2.1.201401081616 acs:1.0.11 alloy:1.3.1-beta npm:1.3.2 titanium:3.2.0-beta titanium-code-processor:1.1.0 Osx: Maverick 10.9 Xcode: xCode 5.0.2 Device: HTC Desire(v4.0.3) and IPhone4s(v7.0) Using both sdk build 3.2.1.v20140108194846 and 3.3.0.v20140108194850 Ti.Media.vibrate working fine. Used Above Test Code to test the issue. On runtime
Required permission gets added in androidManifest file. Issue seems to be fixed and hence closing.
Priya - please read the notes more carefully when you close bugs. This was an emulator issue and should _not_ have been closed against a device.
Reopening ticket to validate against the Android emulator.
Closing ticket as fixed. Verified the VIBRATE and CAMERA permissions are added to the build/android/AndroidManifest.xml file. Also, verified the ti.modules.titanium.media.TiCameraActivity gets added to the build/android/AndroidManifest.xml with camera overlay and without camera overlay (e.g. calling Ti.Media.showCamera() without setting the overlay property). Here is the app.js that I used to verify:
Tested on: Appcelerator Studio, build: 3.2.1.201401081616 SDK build: 3.2.1.v20140109120846, 3.3.0.v20140109120852 CLI: 3.2.1-beta Alloy: 1.3.1-beta2 Device: Android Emulator (2.3.3), Android Emulator (4.3)