Cannot run on production devices - android

When I run my application, the message below is printed in the error log. I don't understand if the problem is from my application or if the message is printed by my Android device.
E/NEW_BHD: Cannot run on production devices!
I read this answer Unable to run 'adb root' on a rooted Android phone , but my device is not rooted.
Why this error log is printed ?

Try enabling this function: go to Settings -> Security Just activate Unknown sources.
Now that you're ready to install your apk.

The main problem (I believe) that causes this, is your mobile's battery.
When Motorola mobiles have low battery, and they're connected to a computer, the USB option for the mobile will be forced to charging only mode.
To solve this, just swipe down from the top, click the USB for charging, touch for more options and select File Transfer. This will resolve your problem.

Try to active Developer Mode on setting of your device.
Enable Developer Options In Android 6.0 Marshmallow
Pull down on the notifications shade and open the Settings app. You can also achieve the same thing from the app drawer if you so wish.
Scroll all the way down and tap on ‘About phone’.
Now scroll down again and you’ll see an entry labelled ‘Build number’. Keep on tapping till you see a prompt that says ‘You are now a developer!’

Related

How do I delete the Device policy work app when uninstall and force quit are disabled?

I got given a phone by a friend which he couldn’t use because of an it administrator lock. The app causing this is called Device policy(com.Google.apps.android.work.clouddbc). The options to uninstall or force quit are greyed out. I have tried everything to do with uninstalling using ADB but nothing works, I also tried unlocking bootloader but I get an error message saying work accounts can’t be set up due to a custom is being installed. What do I do?

Setting Device Owner app problem "Workspace has been locked" Android Oreo 8.1

0
I've been using my app as a deviceOwner App since lollipop. I have a new device here which I want to be DeviceOwner too.
It is a Samsung galaxy Tab A 10.5(2018) SM-T590.
I am currently running this Version of the rom: T590XXU2ASC1.
I am not using NFC method. I usualy create the /data/system/device_owner.xml file by myself. But since it is not working I tryed this method:
1-Factory reset the tablet in recovery mode
2-Pass through the annoying startup menus
3-Set lock screen to none
4-Enable Usb Debugging
5-Install my app adb install MyApplicaton.apk
6-adb shell dpm set-device-owner com.example.myapplication/.MyApplicationReceiver It always says success when i execute the command.
7-Start my app, i can pin/unpin my app without problem.
8-Reboot, and then the famous message appears everytime: Workspace has been locked Unauthorized software has been installed on your device.Workspace has been locked to prevent any unauthorized access. Contact your admin.
Then if i press on the FACTORY DATA RESET button the workspace app crashes then pops back.
I tryed the kioskModeDemo app and the androidDeviceOwner sample app and they all do the same problem.
Anybody have any hints of why this is not working anymore on Android 8(oreo)?
Thanks
I found the problem: Once you oem unlock(custom os) your device on a certain samsung knox level API, you can't be device owner anymore on this device.
This is from Samsung Knox page: "Cannot create work profile" "The security policy prevents the creation of a managed device because a custom OS is or has been installed on this device". https://seap.samsung.com/forum-topic/knox-and-nfc-device-owner-provisioning
The device could be vulnerable to potential attacks with custom os.

Getting "Connecting over ADB to localhost:5277...failed"

Hi all i am trying to launch Desktop Head Unit(DHU) using android ADB.
I have followed all steps what mentioned in installing DHU steps.
But i am getting following error.
Please some body help me how to resolve this.
Make sure you perform the following steps:
Make sure developer mode is enabled on your phone.
Install Android Auto on your phone.
Enable developer mode by tapping on the title in the app several times quickly.
Once in developer mode, tap on the 3 dot menu on the top corner and click "Start head unit server".
Connect your device to the computer.
On your computer now, enable tcp forwarding via "adb forward tcp:5277 tcp:5277" (if this fails, you may need to call adb kill-server). You will need to perform this step any time you disconnect then reconnect your phone to the computer.
Start the DHU by calling desktop-head-unit.exe
"Developer Mode
Finally, a note about developer mode, since a few people will certainly ask. It's still there and accessible in basically the same way. Instead of tapping several times on the lead image, you'll want to give ten quick taps right on the words "Android Auto" in the action bar. Just like before, a toast message will confirm that it worked. But don't expect anything new in the developer options screen, it's identical to the previous version."
AndroidPolice
Enjoy your Android car development ;)
First connect your phone to computer then open android auto on your phone click menu icon(you need to enable developer mode on app first) click start head unit server.Try to open DHU on your computer.

Eclipse/Android Studio Device not showing up in Chooser Dialog

I am trying to debug my android application on a device but it is not showing me any device connected in the chooser dialog. What could be the problem ?
I've tried to change connect and disconnect the device again.
I restarted the eclipse
I checked Window->Preferences->Android it shows me the SDK Targets.
What else can I do. My Computer recognizes the device but the eclipse chooser dialog doesn't show any device connected.
Please help...
There is a third party software named "moborobo" : http://www.moborobo.com/
You can install this there after you didn't need any driver for any perticular mobile device...it will automatically gets detected and you can choose it from the dialogue box. Hope this will help.
Check that your device connected as PTP device(Camera). Notification Bar -> USB Connection.
If your device connected as MTP(as common data storage) then AndroidStudio don't recognize it as debuggable device. At least that works for me and my Nexus.
There is another method that you can use .....when you run your project as android project, it generates an .apk file. Just move that .apk file to your device. Then on device run the application in debug mode.
What you can try is: killing adb.exe (using Windows Task Manager) (your IDE will restart it when needed automatically)
If you have more than one IDE open (for instance eclipse and Android-Studio): shutdown one of them, because there may have some conflicts between them when trying to connect with ADB.
If your device was never recognized through ADB (never shows up in eclipse chooser dialog, nor in Android-Studio chooser dialog): then you can try to install the generic Android Driver provided by Google (<SDK_HOME>/extras/google/usb_driver/)
I often encounter this problem, particularly when starting a particular emulator device for the first time that day. i.e. I launch my app, choose the device, the device starts up - but not before the launch of my app has timed out. I find that although the emulator device appears to have started properly - Eclipse does not recognise it as a "running Android device".
I simply shut down the device and repeat the process. I find that the second attempt is (almost) always successful - even if the app launch "times out", the emulator will be talking to Eclipse and I can then relaunch my app on the running emulator device.
Increasing the ADB connection timeout (defaults to 5000ms: Window...Preferences...Android...DDMS) may or may not help.
Hope this helps !

Android Logcat not showing logs when I switch devices

I am trying to use Logcat to help diagnose my android issues. I frequently have a phone plugged in AND an emulator running. Sometimes I debug on the emulator, sometimes I debug on the phone, or maybe even a third device.
Logcat does not continue to show messages after a device is switched. How can I specify what Logcat does or force it to resume logging without restarting eclipse?
Insight appreciated
I've noticed this at times. Usually one of two things does the trick. First, open the Devices view, verify that the new device is showing, and then switch back to Logcat. That seems to kick Logcat into action again.
If that doesn't work, then in the Devices view menu, select "Restart ADB" (I think that's what it's called; I don't have it open at the moment).
If even that doesn't work, then kill and restart the ADB server from the command line and repeat the above.
If you are using Eclipse, switch to the DDMS perspective.
There, logcat will be showing the log of the selected device in the devices View
(Window -> Open perspective -> Other -> DDMS)
You coupld use the CLI for ADB and reattach the debug process to your switched device. Then Logcat will pick the debug msgs from that connected device. Whatever device is actively connected to ADB will output through Logcat

Categories

Resources