美文网首页
Android studio中Flutter项目打包

Android studio中Flutter项目打包

作者: 波浪眉毛 | 来源:发表于2022-03-17 10:44 被阅读0次

    在项目下创建一个

    在android项目下的build.gradle中添加如下代码

    def keystorePropertiesFile = rootProject.file("key.properties")

    def keystoreProperties =new Properties()

    def fileInputStream =new FileInputStream(keystorePropertiesFile)

    keystoreProperties.load(fileInputStream)

    如果不出现乱码以上代码即可,如果出现乱码,则读取时需要需要手动编码  可以是 gbk utf-8等

    def mInputStreamReader =new InputStreamReader(fileInputStream,"UTF-8")

    keystoreProperties.load(mInputStreamReader)

    最后添加

    signingConfigs{

        release{

            keyAlias keystoreProperties['keyAlias']

    keyPassword keystoreProperties['keyPassword']

    storeFile file(keystoreProperties['storeFile'])

    storePassword keystoreProperties['storePassword']

    }

    }

    然后在控制台Terminal中直接输入  flutter build apk 即可

    相关文章

      网友评论

          本文标题:Android studio中Flutter项目打包

          本文链接:https://www.haomeiwen.com/subject/ijlvdrtx.html