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

2,690

Solution 1

I am a newbie to android studio and flutter development. I was trying out the same dicee flutter app by cloning it on my machine. 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

classpath 'com.android.tools.build:gradle:3.5.3'

to

classpath '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. I am not sure but it worked for me for the time being.

Solution 2

The topic is related to "The Complete Flutter Development Bootcamp Using Dart"

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

So, here are steps to get rid of the problem

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

  compileSdkVersion 29
  targetSdkVersion 29

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 ;)*
Share:
2,690
Admin
Author by

Admin

Updated on December 16, 2022

Comments

  • Admin
    Admin over 1 year

    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 ,

    Package get' has not been run'

    and I cannot also debug it to a Device neither to an 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 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 .

  • Admin
    Admin over 4 years
    do you close the project or the program ?,and do you close it after clicking 'Package get' ?
  • nivla360
    nivla360 over 4 years
    I close the project (that's the only project opened) and I do that after I have clicked on 'Packages get'