Ionic application on different versions of android

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 was left blank. So far, I've built the applications using:

ionic cordova platform add android
ionic cordova build android

I believe that these commands without more parameters create an apk with the most up-to-date version. I would like to lower the minimum version of supported sdk to version 5.0.2, or make a build specific to that version.

Command I tried:

ionic cordova platform add [email protected]

It even built but at the time of generating apk 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 the construction failed.
  • I also downloaded the android 5 API in sdk manager through android studio.

Anyone who can help will thank me right away.

    
asked by anonymous 06.08.2018 / 18:45

0 answers