配置环境错误汇总

新的电脑,从新配置环境

执行flutter命令的时候终端报以下错误

env: bash\r: No such file or directory
  • 下载了window版本,该下载mac版本的包

在run新建flutter项目的时候,报了以下错误

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     build-tools;28.0.3 Android SDK Build-Tools 28.0.3                  
     platforms;android-29 Android SDK Platform 29                       
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
                                                                        
  Using Android SDK: /Users/shuxiaochu/Library/Android/sdk              
                                                                        
* 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.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 2s 
  • 看网上资料,暂且更新一下sdkmanager
  1. 先 cd 到 安装sdk 的 tools/bin 目录下:如
cd /Users/XXXX/Library/Android/sdk/tools/bin
  1. 执行命令
 ./sdkmanager --update (执行过程有点慢,网速好会好很多)

如果你执行上面那个命令又报下面的错误

XXXMacBook-Pro:bin XXX$ ./sdkmanager --update 
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

那么说明你没有安装Java的jar包,装完就可以了
https://www.jianshu.com/p/fe6b68295479

SourceTree 无法通过SSH拉远端库,本人是已经设置好SSH秘钥了,所以如果没配置SSH秘钥的就直接看官方文档

原因是本地没有添加远端库的白名单,所以无法clone 
image.png

通过终端拉一次,就会提示是否加入白名单,然后就可以通过SourceTree拉了
这个问题引用了要淡定这个博主的文章,在此感谢

http://cache.baiducontent.com/c?m=sMDIOq-GJFqB98V0peW4eYStBFxrkKjCV33921C-J-ads-fvLRZnSf0rg9mG5HNKjOFD8l3hGlI9b7wME7T9_X3B2llSGLxuyAnPcVGcKmzhN92hqa-MLemLiy-NkY8uO9nDIhaKaidPWvkwL4mHRZpaW_BfZagO8zRqlWWR-0jg1i04n9-loQq871qFabV2&p=8b2a975686cc42af5fb5de3a524f82&newp=983dc54ad5c346b134bcc7710f07a5231610db2151d0d701298ffe0cc4241a1a1a3aecbf2c251a0ed3c67f640bac4a5bebf331763d0034f1f689df08d2ecce7e31e476&s=cfcd208495d565ef&user=baidu&fm=sc&query=mac+sourcetree+ssh%C0%AD%B2%BB%CF%C2%C0%B4&qid=eb82fb8100015839&p1=5

你可能感兴趣的:(配置环境错误汇总)