I was trying to run my app through my smartphone (a Motorola - Moto G2). For this, I have done the necessary ( installed the USB driver from Motorola and USB debugging), but still does not work. This error appears:
Uploading file local path:C:\Users\Felipe\AndroidStudioProjects\ColetordeDados\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.k19.treinamento.coletordedados Installing com.k19.treinamento.coletordedados DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.k19.treinamento.coletordedados" pkg: /data/local/tmp/com.k19.treinamento.coletordedados Failure [INSTALL_FAILED_OLDER_SDK]
Update your SDK to the newest Version. Use the Android SDK Manager. http://developer.android.com/tools/help/sdk-manager.html
Check in your manifiest that your "android:minSdkVersion" and "android:targetSdkVersion" are correctly set.
Try to set "android:targetSdkVersion" to 23.
And "android:minSdkVersion" to 21