Flutter实战(二、问题汇总-持续更新)

问题汇总-持续更新

一起从0开始Flutter实战!

项目开始了,我们把已经搭建的框架运行一下,果然有报错的出现,我们先看下第一个出现的异常:

 What went wrong:
 Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
 Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
 Could not resolve io.flutter:flutter_embedding_debug:1.0.0-6bc433c6b6b5b98dcf4cc11aff31cdee90849f32.
	Required by:
	project :app
	project :app > project :shared_preferences
 	project :app > project :sqflite
 > Skipped due to earlier error
 > Skipped due to earlier error
 > Skipped due to earlier error

这里的异常是因为我们在项目的配置没有配置完整,我们来看下解决方法:
打开android/build.gradle文件添加:

allprojects {
    repositories {
        google()
        jcenter()
        flatDir {
            dirs 'libs'
        }
        maven {
            url 'http://download.flutter.io'
        }
        maven { url "https://jitpack.io" }
    }
}

问题二:

* What went wrong:
 Execution failed for task ':app:stripDebugDebugSymbols'.
 No version of NDK matched the requested version 21.0.6113669. Versions available locally: 20.0.5594570, 21.2.6472646
 Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

问题原因我们NDK本地有多个版本可选,所以我们可以指定版本,在android/app/build.gradle文件中修改:

android {
    compileSdkVersion 28
    ndkVersion "21.2.6472646"
    }

增加指定版本。

------------------------------------ 分割线 ------------------------------------
以后会持续在本文后面追加遇到的问题,作为问题归结,方便查找,新的知识会单独去开文章来写。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值