无法接受Android许可(Flutter)

时间:2020-02-05 17:33:25

标签: android flutter dart sdk licensing

好吧,一个月前我学习了Flutter,而且一切都很好,没有问题,因此,上周我丢失了PC上的所有内容,需要对其进行格式化,我做到了。所以昨天我尝试安装Flutter,但是在接受Android许可证时,它给了我这个错误:

Warning: File /home/damiani/.android/repositories.cfg could not be loaded.

要解决这个问题,我只是touch .android/repositories.cfg,此消息不再出现,但是现在,当我flutter doctor --android-licenses时,它给了我以下信息:

[========= ] 25% Fetch remote repository...

从这开始,我什么也做不了,它只是卡在了那里...有时甚至给这个:

[============================= ] 75% Computing updates...

或者这个:

[======================= ] 58% Computing updates...

获得的时间更长:

1 of 6 SDK package license not accepted.] 100% Computing updates...             
Review license that has not been accepted (y/N)? y

1/

从那里开始,此消息不会改变...

进行flutter doctor -v时:

[✓] Flutter (Channel master, v1.14.7-pre.120, on Linux, locale pt_BR.UTF-8)
    • Flutter version 1.14.7-pre.120 at /home/damiani/flutter
    • Framework revision 82c00c915c (3 hours ago), 2020-02-05 06:35:49 -0800
    • Engine revision 81dffd1241
    • Dart version 2.8.0 (build 2.8.0-dev.7.0 c8ed304e97)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/damiani/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /var/lib/snapd/snap/android-studio/82/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Android Studio (version 3.5)
    • Android Studio at /var/lib/snapd/snap/android-studio/82/android-studio
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

! Doctor found issues in 1 category.

没有心情继续Flutter。从现在开始谢谢...

抱歉英语不好

操作系统:arch linux

3 个答案:

答案 0 :(得分:1)

切换到Flutter开发者频道对我来说解决了这个问题。跑 flutter channel dev,然后flutter upgrade并尝试 flutter doctor --android-licenses

答案 1 :(得分:0)

尝试运行以下命令,(它应该要求您接受许可证)

ChangePassword _exportFragment = (ChangePassword)FragmentManager.FindFragmentByTag("Dialog");

还要确保运行以下

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.dev.misterj.nocherd">

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permision.CALL_PHONE"/>
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS"/>
    <uses-permission android:name="android.permission.READ_CALL_LOG"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>


    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="AIzaSyAiJNpq-********************" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:theme="@style/AppTheme">

        <activity android:name=".StartActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE" />

                <!-- Accepts URIs that begin with "https://myapp.com/place” -->
                <data android:scheme="https" android:host="myapp.com"  android:pathPrefix="/place"  />
                <!-- Accepts URIs that begin with "myapp://place” -->
                <data android:scheme="myapp" android:host="place" />
            </intent-filter>
        </activity>


        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>


</manifest>

以上两个命令之后,希望您的问题得到解决。

谢谢:)

答案 2 :(得分:0)

发生这种情况是因为您尚未接受所有android许可证。

按照这些步骤,这对我有用。

  1. 打开控制台/终端
  2. 扑扑医生--android-licenses
  3. 接受每个出现的许可证,按y,您就可以开始使用了。