简体   繁体   English

Flutter 不能接受 android 许可证

[英]Flutter can't accept android licenses

I have set up Flutter in my Ubuntu Machine, but cannot accept the Android Licenses, thus am not able to use the tool.我已经在我的 Ubuntu 机器中设置了 Flutter,但无法接受 Android 许可证,因此无法使用该工具。 Flutter appears to be working fine in root, but when I try to run flutter doctor it tells me that Android Licenses have not been accepted, even though I did accept them. Flutter 似乎在 root 中运行良好,但是当我尝试运行flutter doctor它告诉我尚未接受 Android 许可证,即使我确实接受了它们。 If I try to type again flutter doctor --android-licenses it works as though I never accepted the licenses.如果我尝试再次输入flutter doctor --android-licenses它就好像我从未接受过许可证一样。 If I accept all of them once more, it just gets back to as though I never accepted them.如果我再次接受所有这些,它就会回到好像我从未接受过它们一样。 I could use flutter in root, but that's not really secure and I would rather have it usable as a normal user.我可以在 root 中使用 flutter,但这并不安全,我宁愿让它作为普通用户使用。

EDIT: The solution appears to lie in the repositories.cfg file.编辑:解决方案似乎位于 repositories.cfg 文件中。 It appeared to be missing and adding a blank file with that name solved the issue.它似乎丢失了,添加一个具有该名称的空白文件解决了这个问题。

Go to your $ANDROID_HOME/tools/bin and open the command line转到您的$ANDROID_HOME/tools/bin并打开命令行

Run the following command ./sdkmanager --licenses运行以下命令./sdkmanager --licenses

Accept All licenses listed there.接受此处列出的所有许可证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM