Android Compile SDK Version of Monaca 6.5.0



  • In this document : https://docs.monaca.io/en/ . It says build version is : 26 .
    But when i build my application , it show 25 .
    Android target: android-25

    - Cordova platform add -
    $ /data/build-server/cordova/6.5.0/bin/cordova platform add /data/build-server/cordova/platforms/android/6.2.3
    Adding android project...
    Creating Cordova project for the Android platform:
        Path: platforms/android
        Package: com.example.helloworld
        Name: HelloWorld
        Activity: MainActivity
        Android target: android-25
    

    How can i change Compile SDK Version to 26 ?
    Because when i use new lib (appcompat-v7:26.0.2) , it out below error when i build application .

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':processDebugResources'.
    > com.android.ide.common.process.ProcessException: Failed to execute aapt
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    Error: /private/tmp/monaca/59b8f756013eb0a62cb23bfb/project/platforms/android/gradlew: Command failed with exit code 1 Error output:
    注意:一部の入力ファイルは非推奨のAPIを使用またはオーバーライドしています。
    注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
    注意:一部の入力ファイルは非推奨のAPIを使用またはオーバーライドしています。
    注意:詳細は、-Xlint:deprecationオプションを指定して再コンパイルしてください。
    /private/tmp/monaca/59b8f756013eb0a62cb23bfb/project/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
        
    /private/tmp/monaca/59b8f756013eb0a62cb23bfb/project/platforms/android/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
    

    Thanks in advance !


  • Monaca

    @ボーツァンツォンドック Hi,
    You can configure the Android SDK version in the config.xml file as follows:

    <!-- These preferences are actually available in Cordova by default although not currently documented -->
        <preference name="android-minSdkVersion" value="10" />
        <preference name="android-maxSdkVersion" value="22" />
        <preference name="android-targetSdkVersion" value="21" />
    

    Or like this:

    
        <!-- Or you can use a config-file element for them -->
        <config-file target="AndroidManifest.xml" parent="/*">
            <uses-sdk android:maxSdkVersion="22" android:minSdkVersion="10" android:targetSdkVersion="21" />
        </config-file>
    


  • @khemry
    I did it . But it’s target SDK Version , not compile SDK version .


  • Monaca

    @ボーツァンツォンドック
    Hi,
    I set the config.xml file as follows:

          <preference name="android-minSdkVersion" value="16" />
          <preference name="android-maxSdkVersion" value="26" />
          <preference name="android-targetSdkVersion" value="26" />
        </platform>
    

    Then, I downloaded the APK file and run the following command:

    $ aapt dump badging platforms/android/build/outputs/apk/android-debug.apk
    

    Here is my result:

    sdkVersion:'16'
    maxSdkVersion:'26'
    targetSdkVersion:'26'
    


  • @khemry Thanks for your help .
    But i think it’s completely different .
    TargetSDK is different with compile SDK .

    Maybe i wrong ?


  • Monaca

    @ボーツァンツォンドック

    You are right. They are not the same.
    Our build server has the compile SDK of 25. The reason is that our build server is using Cordova 6.5. In other words, unless we upgrade to Cordova 7, we won’t be able to have higher compile SDK than 25. Regarding the upgrade to Cordova 7, we don’t have a specific release date yet but we’re already working on it.


Log in to reply