unknown permission android.permission.RECORD_VIDEO - android

Suddenly in my logs in "warn" I've found this :
unknown permission android.permission.RECORD_VIDEO
And this happened on a device that fails to do a MediaRecorder.start() method with simple and uninformative "start fails" error message.
java.lang.RuntimeException: start failed.
at android.media.MediaRecorder.start(Native Method)
at com.vladdrummer.headsup.ScreenVideoRecorder.record(ScreenVideoRecorder.java:94)
App is working on many devices, but some have this kind of a problem - it fails to start, although , preparing went fine
So, may be theese two errors are connected? what should I do with "unknown permission android.permission.RECORD_VIDEO" ??

There is no permission as
android.permission.RECORD_VIDEO
See here
Ideally you should be using these permission
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
Also manifest should have
<uses-feature android:name="android.hardware.Camera"/>

Related

Android 'App not Installed' Error - Failed to delete .tmp file

I'm trying to update my app by downloading the apk and open. But the response message is "App not installed".
The logcat error:
2020-12-10 13:49:26.822 1628-1654/? W/PackageManager: Package br.com.app signatures do not match the previously installed version; ignoring!
2020-12-10 13:49:26.827 1503-1523/? E/installd: Failed to delete /data/app/vmdl128035576.tmp: No such file or directory
2020-12-10 13:49:26.837 1628-5285/? I/ActivityManager: START u0 {dat=file:///data/user_de/0/com.google.android.packageinstaller/no_backup/package2911160709080656908.apk flg=0x2000000 cmp=com.google.android.packageinstaller/com.android.packageinstaller.InstallFailed (has extras)} from uid 10019
2020-12-10 13:49:26.928 10096-10096/? D/InstallFailed: Installation status code: 1
Permissions on Manifest:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
This error only happens if I generate the signed apk (using v1 and v2 signatures).
PS: Already tried to put "android:testOnly=false" (on Manifest and gradle.properties)
I remember I had this problem months ago and it was a disaster for me, finally I realized that I had signed and deployed my app with DIFFERENT SIGN KEYS so I could not update my app cause it got stopped after updating and I should remove my app and then reinstall it.
You can also use ADB to see the actual log while you are updating your app its located on your pc where your android studio installation files are you can run it and see the logs.
ADB is a bridge that connects your pc to your android phone and it gives you more information than your android studio logcat about what's actually happening.
another problem that I guess you might have is that you dont update your database version number properly and there might be a conflict between your DB VERSION NUMBERS, But its just a guess.

Exceptions are not being caught in Android Studio when debugging

I have imported a project that was developed on Eclipse into Android Studio.
The project is working perfectly when running\debugging it from Eclipse on my device.
When debugging from the Android Studio on my device, the application is crashing and no exception is being caught on the Android Studio.
When I place breakpoints, they work fine, so I know i'm debugging the correct code :)
Edit:
I have run it again and got the following Exception in the logcat (shouldn't the debugger stop somewhere in the code to show the Exception? like in the line that tries to access the file?):
2018-10-24 11:25:26.027 25903-25903/? E/libpersona: Couldn't open the File - /data/system/users/0/personalist.xml - No such file or directory
2018-10-24 11:25:31.735 23290-23301/? E/DatabaseUtils: Writing exception to parcel
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=25858, uid=10314 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:639)
at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:505)
at android.content.ContentProvider$Transport.query(ContentProvider.java:217)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:102)
at android.os.Binder.execTransact(Binder.java:682)
Although I do have permissions set in the AndroidMenifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.eibimalul.smartgallery"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_SOCIAL_STREAM"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Edit 2: The Solution:
So apparently I was missing 2 things:
run-time permissions which I understood using this link here and with the help of #Pier Giorgio Misley's comment
I was missing permissions on the AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
The solution:
Apparently I was missing 2 things:
Run-time permissions which I understood using this link here and
with the help of #Pier Giorgio Misley's comment
I was missing permissions on the AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
I am not sure if that's the right way to do it (answering my own question that is), since I got help from few developers here (#Pier Giorgio Misley in particular) in the comments only, but I thought it is important to mark the question as answered.

java.lang.SecurityException despite INTERNET permission being in the manifest

I am getting the following error when I run my application on my phone:
java.lang.SecurityException: Permission denied (missing INTERNET permission?)
I have already added that permission in my manifest file as follows:
<uses-permission android:name="ANDROID.PERMISSION.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
I am getting the error only when I run the app on my phone. It runs fine on my GenyMotion emulator. I read similar questions on SO before posting it. Also, I have made a couple of apps before with same permissions, and this error had never occurred then. So I don't get why Android is messing it up this time.
P.S.: I updated my SDK tools before starting with this new application. Somehow felt that it was important to mention it!
Use small caps
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Fail to connect to camera service android.hardware.Camera.open

There are many questions similar to this, but still I am facing this issue.
Camera is working, when my app launch from application. But When I relaunching the app (through Intent Service) I am getting following errors.
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.native_setup(Native Method)
at android.hardware.Camera.<init>(Camera.java:410)
at android.hardware.Camera.open(Camera.java:365)
And I tried with these cases like camera.release(); in onResume. But Still I am getting errors.
In Manifest file I specified the permissions. The Permissions are as follows.
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.front"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />
I have the exact same error, with the same permissions as you in my Manifest file. So far, I have found that if I build my app with
android:targetSdkVersion="23"
I get the aforementioned error in Android Marshmallow devices, while if I build my app with targetSdkVersion less than 23 everything works as expected. I am still troubleshooting it, so in case I get anything more I will post an update.
Hope it helps.

application requires feature(s) not available on your device

I have an Android application on Android Market, but some users are complaining about an error shown when the installation starts, just after the download:
One of them sent me a video of this error showing up, and I could see that this error is not caused by the application, but probably in the verification of permission/features process.
As far as I know, this error is just happening on Motorola Droid/Milestone devices running Eclair, it doesn't happen with Froyo. Unfortunately, I don't have access to any device like this one in order to run logcat and check what's going on.
Here are my permission/features on AndroidManifest.xml:
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.location" />
<uses-feature android:name="android.hardware.telephony" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I finally found out what's happening by getting a Droid device and running logcat:
E/PackageManager( 1280): Package com.mycompany.myapp requires unavailable feature android.hardware.telephony; failing!
Motorola Droid devices running Eclair are not able to install applications that declare
<uses-feature android:name="android.hardware.telephony" />
in their manifest. It's very strange, though, because the Android Market should hide it from these devices. This is probably a bug caused by the changes made to the Eclair by Motorola, since it doesn't happen with other devices running Eclair, neither with the same Droid running Froyo.
According to the docs:
Android Market attempts to discover an application's implied feature
requirements by examining other elements declared in the manifest
file, specifically, <uses-permission> elements.
Given that, have you tried removing the uses-feature tags? Since those are implied by the uses-permissions tags, and you aren't using the "android:required" attribute.
The device say " this feature is not available in this device " when I'm installing an app downloaded from play store and i have to give it permission

Categories

Resources