Ionic application on different versions of android

Asked

Viewed 663 times

1

I’m having a problem creating an apk that runs on different versions of android. My phone has version 6.0.1 and runs perfectly but when I tried to install on an android 5.0.2 the application opened but the screen went blank. So far I was building the apps using:

ionic cordova platform add android
ionic cordova build android

I believe that these commands without extra parameters create an apk with the most updated version. I would like to decrease the minimum version of the supported sdk to version 5.0.2, or build a specific one for that version.

Command I tried:

ionic cordova platform add [email protected]

Even built but when generating the apk of the following error:

> cordova build android
cordova-android-support-gradle-release: Android platform: cordova-android@6
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Marketing\Documents\ionic\Orcamento\platforms\android\build.gradle
cordova-android-support-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open 'C:\Users\Marketing\Documents\ionic\Orcamento\platforms\android\cordova-android-support-gradle-release\properties.gradle'
cordova-android-support-gradle-release: Android platform: cordova-android@6
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\Marketing\Documents\ionic\Orcamento\platforms\android\build.gradle
cordova-android-support-gradle-release: ERROR: EXCEPTION: Error: ENOENT: no such file or directory, open 'C:\Users\Marketing\Documents\ionic\Orcamento\platforms\android\cordova-android-support-gradle-release\properties.gradle'
(node:1496) UnhandledPromiseRejectionWarning: CordovaError: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
    at C:\Users\Marketing\Documents\ionic\Orcamento\platforms\android\cordova\lib\check_reqs.js:45:27
    at ChildProcess.exithandler (child_process.js:282:5)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:1496) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1496) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  • I tried to manually change '27.+ to a lower version but without success she returned after construction failed.
  • I also downloaded the android 5 API in sdk manager by android studio.

Who can help I thank you in advance.

  • Depending on the plugins you’re using, it’s impossible to support previous versions of Android.

  • Thank you for answering, yes I have science that depending on the plugin installed will not have support, however.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.