简体   繁体   English

从 git 问题克隆 Android Studio 上的 Flutter -Package get' has not been run'

[英]Flutter on Android Studio cloning from git problem -Package get' has not been run'

has any one faced this problem before ?有没有人遇到过这个问题? when I clone any Flutter project from Git to Android Studio, then try to click on Get Dependencies , the operation is completed normally but it does not disappear ,当我从 Git 克隆任何 Flutter 项目到 Android Studio 时,然后尝试单击 Get Dependencies ,操作正常完成但它没有消失,

Package get' has not been run'包 get'尚未运行'

and I cannot also debug it to a Device neither to an AVD !,而且我也不能将它调试到设备,也不能调试到 AVD !,

, ,

when I run debug this is the output :当我运行调试时,这是输出:

 Launching lib\main.dart on SM J410F in debug mode...
[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on .
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:186: error: resource android:attr/fontVariationSettings not found.
  C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:187: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

  Command: C:\Users\redoneb\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\d4c8a434a1d578131ca17eb255940ee5\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\redoneb\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          co.appbrewery.dicee\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\redoneb\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\3eb4fa90d4b2cfa5cc449030c34cdf03\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\redoneb\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\3eb4fa90d4b2cfa5cc449030c34cdf03\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:\Users\redoneb\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\d4c8a434a1d578131ca17eb255940ee5\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\redoneb\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          co.appbrewery.dicee\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\redoneb\AndroidStudioProjects\dicee-flutter\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* 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 37s
Finished with error: Gradle task assembleDebug failed with exit code 1

and this is a screen-shot : Flutter Android Studio Problem Package get has not been run这是一个屏幕截图: Flutter Android Studio Problem Package get has not been run

Flutter Doctor output :颤振医生输出:

C:\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, v1.12.13+hotfix.5, on Microsoft Windows [Version 6.3.9600], locale ar-DZ)
    • Flutter version 1.12.13+hotfix.5 at C:\flutter
    • Framework revision 27321ebbad (2 weeks ago), 2019-12-10 18:15:01 -0800
    • Engine revision 2994f7e1e6
    • Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\redoneb\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
    • All Android licenses accepted.

[√] Android Studio (version 3.5)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.40.2)
    • VS Code at C:\Users\redoneb\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.6.0

[√] Connected device (1 available)
    • SM J410F • f43a6812 • android-arm • Android 8.1.0 (API 27)

• No issues found!
Process finished with exit code 0

this happens with every Flutter project that I clone .我克隆的每个 Flutter 项目都会发生这种情况。

The topic is related to " The Complete Flutter Development Bootcamp Using Dart "该主题与“ 使用 Dart 的完整 Flutter 开发训练营”有关

When something wrong and doesn't work,当出现问题并且不起作用时,
It's okay in the software development world.这在软件开发领域没问题。

I also had the same issue on Android after cloning and trying to launch them克隆并尝试启动它们后,我在 Android 上也遇到了同样的问题

So, here are steps to get rid of the problem所以,这里有解决问题的步骤

1) your-cool-flutter-project/android/app/build.gradle 1) your-cool-flutter-project/android/app/build.gradle

In this file be sure that you have 29 API used two times if you see 27 then modify to 29 like these在这个文件中,如果你看到 27,请确保你有 29 个 API 使用了两次,然后像这样修改为 29

  compileSdkVersion 29
  targetSdkVersion 29

2) your-cool-flutter-project/android/gradle.properties 2) your-cool-flutter-project/android/gradle.properties

Check that file has these two lines if they miss then add them检查文件是否有这两行,如果他们错过了然后添加它们

android.useAndroidX=true
android.enableJetifier=true

That's all.就这样。 Take a breath.喘口气。 Relax.放松。 And launch the app =)并启动应用程序 =)

  • I very hope you have the latest Android and Flutter installed ;)*我非常希望你安装了最新的 Android 和 Flutter ;)*

I am a newbie to android studio and flutter development.我是 android studio 和 flutter 开发的新手。 I was trying out the same dicee flutter app by cloning it on my machine.我通过在我的机器上克隆它来尝试相同的 dicee flutter 应用程序。 I don't know exactly what the problem was, but in my android/gradle/build.gradle file of the cloned project I edited the following line我不知道到底是什么问题,但在克隆项目的android/gradle/build.gradle文件中,我编辑了以下行

classpath 'com.android.tools.build:gradle:3.5.3'类路径 'com.android.tools.build:gradle:3.5.3'

to

classpath 'com.android.tools.build:gradle:3.5.0'类路径 'com.android.tools.build:gradle:3.5.0'

which was similar to the projects created by me offline.这类似于我离线创建的项目。 This might be due to running an older version of this gradle stuff on my machine.这可能是由于在我的机器上运行了这个 gradle 东西的旧版本。 I am not sure but it worked for me for the time being.我不确定,但它暂时对我有用。

在我不知道为什么会发生之前,我遇到了这个问题,但我所做的是关闭项目并再次打开它,这似乎解决了我的问题。

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

相关问题 从Git导入和克隆到android studio - Import and cloning from Git to android studio 来自Android Studio中Git的克隆项目 - cloning project from Git in Android Studio 从git克隆存储库时Android Studio复制和粘贴问题 - Android Studio copy and paste issue when cloning repository from git 运行 Flutter 项目的 android Studio 出现问题 - Problem with android Studio with run a Flutter project 在 Android Studio 中从 Gitlab 克隆存储库时出现“存储库测试失败”错误? - Getting “Repositroy test has failed” error while cloning repository from Gitlab in Android Studio? Android Studio:从存储库中克隆项目后,我无法运行/调试我的项目 - Android Studio: I can not run/debug my project after cloning it from my repository android studio flutter 上的包目录 - package directory on android studio flutter Android Studio在git克隆时给我带来了困难 - Android studio giving me a hard time while git cloning 在 FLutter 试图让 JSON 有这个问题:[ LateInitializationError: Field '_userData@577066488' has not been initialized] - In FLutter trying to get JSON had this problem: [ LateInitializationError: Field '_userData@577066488' has not been initialized] 在已经在playstore中发布的android中添加软件包 - add package in android that has been publish in playstore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM