Category: Android

React native with Android – Fix : Device unauthorized

Check developer is enabled in the phone settings

One reason your phone is not detected is that you don’t have enabled the developer mode in the Android Settings.

Check the connected android devices with adb devices

Now you can check if your phone is connected with adb devices

sh-3.2# adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
CBAA004484J41536762     unauthorized

Authorise your device with adb kill-server and adb devices

If your phone still not asking anything while connected, you can force the adb service to restart like that:

sh-3.2# adb kill-server
sh-3.2# adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully

Then now you should be able to see a message on your phone asking if you authorise the computer.
Now you should be able to do your react-native run-android or yarn android

Solving errors of publishing an app on Google Play – Cordova / Ionic

INVALID APP VERSION :versionCode OR versionName

You should have a look on the following files:
platforms\android\AndroidManifest.xml
You will find the tag “android:versionCode” and ” android:versionName”.
config.xml
You will find the tag “android-versionCode” and ” version”.

Don’t forget to change this file and not only the AndroidManifest.xml because if you are using the Ionic Cordova command to build, this one:

ionic cordova build android --prod --release

It will takes the version from config.xml and should regenerate AndroidManifest.xml.

INVALID ANDROID SDK VERSION

• Open Android Studio
• Download the latest version of the Android SDK, by going File > Project Settings :

The latest API level is 30

• Set the latest API level on File > Project Structure :