0

I receive the "error :the package com.badlogic.gdx does not exist" when you try to start the project.

In my project there is a libGDX. Classes see it and objects from this libGDX are used. But when trying to compile an application, this error occurs.

At the same time, there are no errors in the classes on which this error is made.

"Sync Project with Gradle Files" and "Invalidate caches/restart" did not help.

Someone came across similar? How to fix this?

enter image description here

Community
  • 1
  • 1
Ivan Abakumov
  • 128
  • 1
  • 13

1 Answers1

3

Go to libs folder, right-click on libraries you want then select: Add as library

The reason is, you should add the external libraries on Build.Gradle if the online source from maven-jcenter or etc is not available and you have to add them manually.

After doing this, try rebuild the project then you're good to go.

Or in code: (in not added cases by IDE)

implementation fileTree(dir: 'libs', include: ['*.jar'])

Replace the name instead of * in above code.

How to add a jar in External Libraries in android studio

And: How to add a jar in External Libraries in android studio

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108