【问题标题】:How to migrate to AndroidX in my Flutter project?如何在我的 Flutter 项目中迁移到 AndroidX?
【发布时间】:2019-09-14 16:32:33
【问题描述】:

我尝试迁移我的项目。但我做不到。

迁移到 AndroidX

在项目中未找到任何用法

【问题讨论】:

    标签: android dart flutter androidx


    【解决方案1】:

    在 gradle.properties 中添加

    android.enableJetifier=true
    android.useAndroidX=true
    

    在项目 build.gradle 中,

    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.30'
    classpath 'com.google.gms:google-services:4.2.0'
    

    相反,我有这些并且它有效:

    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.2.0'
    

    或

    classpath 'com.android.tools.build:gradle:3.4.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.2.0'
    

    【讨论】:

    【解决方案2】:

    在 android studio 中打开 flutter 项目的 android 文件夹。应该可以的。

    如果这不起作用,那么您应该手动进行。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-06-21
    • 2021-01-12
    • 2019-07-08
    • 1970-01-01
    • 1970-01-01
    • 2019-12-25
    • 2020-03-29
    相关资源
    最近更新 更多