Android device showing offline with USB debugging

When I tried to run Android application in my mobile from Android Studio, I stuck with the error stating the application my Device was Offline.

When I run the command adb devices the error as follows

List of devices attached
00b445g34****** offline

To Enable the USB debugging option in Android device

1. Go to Settings, and select Applications > Development
2. Enable USB debugging
3. For Devices with Android KitKat and go to Settings > About devices > Tap 7 times on “Build Number”
4. Once Developer Option is enabled in the Settings, Enable USB debugging
5. Update the Android SDK Tools in Android SDK Manager
6. Traverse to \android-sdk\platform-tools and run adb devices
7. If still the problem exists restart the ADB server

adb kill-server
set ADB_TRACE=all
adb nodaemon server
adb devices

8. The ADB_TRACE will help you trace and resolving the issues like permission and others.
9. If still the problem exists kill the adb process killall adb in linuxoids and taskkill /IM adb.exe
10. Disconnect your mobile, Developer option > Revoke USB debugging authorizations (KitKat and above)
11. Restart your mobile and connect to PC. You will be asked to verify the RSA, do the same and add the device
12. Now try running adb devices, boom the device is online

List of devices attached
00b445g34****** device

The same scenario happened when I tried to run debug my AIR application in Flash developer, follow all the steps above in addition the next few steps too.

1. Copy the following files from \android-sdk\platform-tools aapt.exe, adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll, dx.jar (dx.jar from lib folder)
2. Paste them into \lib\android\bin
3. Run the command adb version from the same folder in command prompt
4. Result should be as follows
Android Debug Bridge version 1.0.31
5. Version should be greater or equal to 1.0.31

Errors running builder ‘JavaScript Validator’ on project

I got this annoying exception on every auto build of my Dynamic Web Project.

“Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘GenieAlert’.
java.lang.NullPointerException”

I was trying to stop the validation of Javascript in the Eclipse properties with the following options,

Windows -> Preferences -> Validation -> Client-side JavaScript Validator -> Checked Manual & Unchecked Build.

This option didn’t work out, then I realized that it happens only on the Build time. The following option came in handy to do that.

Project -> Properties -> Builders -> Unchecked ‘Javascript Validator’

Sometimes when you try to run the Web projects from eclipse on servers these JavaScript validation stops the deployment of the project on servers stating “JavaScript Validation Exception found”. I hope the above solutions will help in those situations too.