1

I experienced a problem in this section Could not determine the dependencies of task': app: compileProfileJavaWithJavac I have searched various sources but have not found a solution, and I use the flutter framework.

I have tried various ways such as searching for references related to my problem, but I did not find a solution, either on github, stackoverflow and also flutter.

Could not determine the dependencies of task ':app:compileProfileJavaWithJavac'.

Could not resolve all task dependencies for configuration ':app:profileCompileClasspath'. Could not find androidx.legacy:legacy-support-v4:28.0.3.

piet.t
  • 11,718
  • 21
  • 43
  • 52

1 Answers1

1

You have to migrate to AndroidX.

Go to your android/gradle.properties and add this line of code:

android.useAndroidX=true

This will make sure to use the AndroidX library instead of the Support library.

EDIT:

You may also want to add android.enableJetifier=true which enables you the Jetifier, i.e: a set/collection of libraries to make developer's life easier. For more info. look here.

netlemon
  • 964
  • 8
  • 22
  • I have added the second but it still shows the same problem, about the core problem, huh please give instructions – rahmad iqbal Jul 10 '19 at 09:26
  • Have you added `android.useAndroidX = true` ? – netlemon Jul 10 '19 at 09:27
  • android.useAndroidX = true and android.enableJetifier = true,I have added – rahmad iqbal Jul 10 '19 at 09:33
  • Did you get another error by adding those lines, if yes please provide us with the stacktrace – netlemon Jul 10 '19 at 09:37
  • even strange when I delete android.useAndroidX = true and android.enableJetifier = true the error is even reduced by one – rahmad iqbal Jul 10 '19 at 09:39
  • https://i.stack.imgur.com/vgXAE.png I just tried to make a question on stackoverflow, please understand if my method of displaying images is not good – rahmad iqbal Jul 10 '19 at 09:47
  • #newbie99 https://i.stack.imgur.com/vgXAE.png I just tried to make a question on stackoverflow, please understand if my method of displaying images is not good – rahmad iqbal Jul 10 '19 at 09:49
  • In your terminal please run `flutter doctor` and send us the result – netlemon Jul 10 '19 at 09:54
  • @rahmadiqbal go in your build.gradle and if you don't have `google()` in your repository, add it.. like this `buildscript { repositories { google() jcenter() }` – netlemon Jul 10 '19 at 09:57
  • Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel dev, v1.8.0, on Microsoft Windows [Version 10.0.14393], locale id-ID) [√] Android toolchain - develop for Android devices (Android SDK version 29.0.0) [√] Android Studio (version 3.4) [√] VS Code (version 1.36.1) [√] Connected device (1 available) • No issues found! – rahmad iqbal Jul 10 '19 at 09:59
  • @rahmadiqbal Try and add the `google()` in your build.gradle repository – netlemon Jul 10 '19 at 10:02
  • in allprojects?? – rahmad iqbal Jul 10 '19 at 10:03
  • I've added it, allprojects { repositories { google() jcenter() maven { url "https://dl.bintray.com/android/android-tools" } } } – rahmad iqbal Jul 10 '19 at 10:04
  • Last thing I can do is to check you pubspec.yaml and both build.gradles. Send picture of them – netlemon Jul 10 '19 at 10:08
  • https://i.stack.imgur.com/LiGEV.png https://i.stack.imgur.com/8lT5j.png https://i.stack.imgur.com/K61TO.png https://i.stack.imgur.com/43fiz.png https://i.stack.imgur.com/0J026.png https://i.stack.imgur.com/jyWbE.png https://i.stack.imgur.com/WQokg.png https://i.stack.imgur.com/RP8yk.png https://i.stack.imgur.com/75E1E.png – rahmad iqbal Jul 10 '19 at 10:22
  • this is my capture – rahmad iqbal Jul 10 '19 at 10:23
  • You got some errors in the build.gradle file, did you try to fix those first? – netlemon Jul 10 '19 at 10:25
  • tell me how to fix it? – rahmad iqbal Jul 10 '19 at 10:28