0 Replies Latest reply on Oct 9, 2018 3:13 PM by lucas amaral

    How to generate .apk file on linux sistems?

    lucas amaral Level 1

      After a lot of trouble to instal Phonegap, cordova Android sdk, setting theyr PATH variables, home variables, finding the right version of java (wich is 8, by the way), I still am unable do generate an .APK file. Obviously, I am using Phonegap CLI version. Documentation, both on Android and Cordova for command-line tools are both terribly poor.

       

      There is what I did, created a project "phonegap create com.phonegap.test" includded android "phonegap add android" build, install, everything else "phonegap run android", "phonegap run", everything I could think of. The file was supposed to have been created, but no.

       

      Cordova requirements seems to be all ok

       

      Android Studio project detected

      Requirements check results for android:

      Java JDK: installed 1.8.0

      Android SDK: installed true

      Android target: installed android-26

      Gradle: installed /usr/share/gradle/bin/gradle

       

       

      On "phonegap run android -d", I have gotten those lines (not all included)

       

       

       

      publishNonDefault is deprecated and has no effect anymore. All variants are now published.

       

      The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

       

              at build_882bvtp51s2odch9l4ea9w43g.run(/home/xxxxx/Documentos/PhoneGap/com.phonegap.teste/pl atforms/android/app/build.gradle:143)

       

      Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.

      [...]

      16:5-74 Error:

       

              uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [:CordovaLib] /home/lucas/Documentos/PhoneGap/com.phonegap.teste/platforms/android/CordovaLib/build/int ermediates/manifests/full/debug/AndroidManifest.xml as the library might be using APIs not available in 14

              Suggestion: use a compatible library with a minSdk of at most 14,

                      or increase this project's minSdk version to at least 16,

                      or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)

       

      [...]

       

      :app:processDebugManifest

      FAILED

       

      FAILURE: Build failed with an exception.

       

      * What went wrong:

      Execution failed for task ':app:processDebugManifest'.

       

      > Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 16 declared in library [:CordovaLib] /home/xxxx/Documentos/PhoneGap/com.phonegap.teste/platforms/android/CordovaLib/build/inte rmediates/manifests/full/debug/AndroidManifest.xml as the library might be using APIs not available in 14

       

              Suggestion: use a compatible library with a minSdk of at most 14,

                      or increase this project's minSdk version to at least 16,

                      or use tools:overrideLibrary="org.apache.cordova" to force usage (may lead to runtime failures)

       

      * Try:

      Run with --stacktrace

      option to get the stack trace. Run with --info or --debug option to get more log output.

       

      * Get more help at https://help.gradle.org

       

      BUILD FAILED in 7s

       

       

       

      Please, ADOBE, make things right, name all that you need and use for phonegap and cordova, PLEASE, I am tired of searching everywhere on internet so solve problems of your platform.

       

       

      I just want to build a single apk, no matter the version of the android, I have installed the version 26 on my computer.

       

      $ phonegap -v

      8.0.0

       

      $ phonegap platforms

      Installed platforms:

        android 7.0.0

      Available platforms:

        browser ~5.0.1

        ios ~4.5.4

        osx ~4.0.1

        windows ~5.0.0

        www ^3.12.0

       

       

      $ phonegap plugins

      cordova-plugin-battery-status 1.2.5 "Battery"

      cordova-plugin-camera 2.4.1 "Camera"

      cordova-plugin-compat 1.2.0 "Compat"

      cordova-plugin-device 1.1.7 "Device"

      cordova-plugin-dialogs 1.3.4 "Notification"

      cordova-plugin-file 4.3.3 "File"

      cordova-plugin-geolocation 2.4.3 "Geolocation"

      cordova-plugin-globalization 1.0.9 "Globalization"

      cordova-plugin-inappbrowser 1.7.2 "InAppBrowser"

      cordova-plugin-media-capture 1.4.3 "Capture"

      cordova-plugin-network-information 1.3.4 "Network Information"

      cordova-plugin-vibration 2.1.6 "Vibration"