How to add android target / API android-26 in android studio?

后端 未结 3 1129
甜味超标
甜味超标 2021-01-04 00:47

I am new in android development tools and I\'m about to try cordova to develop android app using web technologies, but when i use the comand cordova requirements the result

相关标签:
3条回答
  • 2021-01-04 00:52

    Android Studio on macOS has platform settings at Preferences... > Appearance & Behavior > System Settings > Android SDK > SDK Platform tab. Checking Android 8.0 (Oreo) having the API level 26 and clicking Apply installed the package and now the requirements check passes as follows:

    Requirements check results for android:
    Java JDK: installed 1.8.0
    Android SDK: installed true
    Android target: installed android-27,android-26
    Gradle: installed /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
    

    Hope this works on Windows as well.

    0 讨论(0)
  • 2021-01-04 00:53

    If using Ionic Cordova(Ionic 3), the plugin:cordova-plugin-ionic-webview now includes the Android target when installed.

    in config.xml:

    <plugin name="cordova-plugin-ionic-webview" spec="^2.2.0">
        <variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
    </plugin>
    

    in package.json:

    "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      }
    

    When adding android platform:

    > cordova platform add android --save
      Using cordova-fetch for cordova-android@~7.1.1
      Adding android project...
      Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.packageName.projectName
        Name: Project Name
        Activity: MainActivity
        Android target: android-27
    
    0 讨论(0)
  • 2021-01-04 01:17

    Another option from the terminal:

    go to: "C:\Users\YOU-USER-NAME\AppData\Local\Android\Sdk\tools\bin"

    sdkmanager "platform-tools" "platforms;android-26"
    

    as listed here: https://developer.android.com/studio/command-line/sdkmanager

    0 讨论(0)
提交回复
热议问题