Add library 'Gradle:' to classpath in Android Studio - android-studio

The project is a generated LibGDX project. It used to work fine, but when I updated to Android Studio Chipmunk, the android module din't work fine anymore. So recently, I've updated to the Dolphin version which I thought could fix the problem. Well, it's still the same:
Error Image
As you can see, the external dependencies aren't detected and causing unresolved symbol errors. The library includes: the 'core' module, libgdx Android backend, and Play Service Ads (Admob).
I've tried rebuilding the project, updating everything that is possible, and tried solving it in the build.gradle file. However, it seems to be a problem in the IDE or me...
The project still builds and runs well, as if there's nothing wrong at all.
How can I fix this problem?

Related

How do I remove libraries from the makefile in android studio?

So I have a c++ game that I compile to an android app using the ndk. I use android studio with gradle to achieve this. I have an Android.mk file where I add all my includes and libraries (in the LOCAL_SHARED_LIBRARIES section) such as SDL2, SDL2_image, Box2D and so on. I tried out firebase analytics for a while, but ended up not using it. I had firebase_analytics in my android makefile just like the other libraries, and then removed it and its related things when I was done with it. However, when I build my project it gives me an error saying no rule to make target 'firebase_analytics'. Why is it still trying to build firebase? I removed it from the file. Maybe it cached something and it's building off of that? I tried cleaning the project and rebuilding it but it gives me the same error. Anyone know why this is happening (and what I can do to solve it)? Thanks for any help.

Can't set up a KMM project in android studio for the first time

I've never worked with KMM (Kotlin Multiplatform Mobile) before. I just updated to the latest version of kotlin and installed KMM Plugin in android studio then restarted android studio(Using this link). Then I created a new project(using this link) but it gave me this error. I don't know what to do, I've tried clearing cache and restart and also tried creating another project but it still gives the same error.
I've built android apps in my android studio before with java and kotlin and it works perfectly. So maybe this is an error of KMM or such?
Change the offending string like this:
"src\androidMain\AndroidManifest.xml"
to
"src\\androidMain\\AndroidManifest.xml"
i.e. add another \ with each \ in the path.
This threw me off as well, since one expects a new project skeleton to just work.
Hope this sorts it out for you, this worked for me.
Yes, you are getting this error, because there is only one slash before a and A in your shared build.gradle.kts file as shown in attached screenshot.
so, to solve this you need to add one more slash before both as per the attached below screenshot:
that's it!

How to resolve symbols #mipmap and #style in Flutter project?

A while ago my designed Flutter app was running like it should in simulation (virtual device) in Android Studio. After some updates of both Flutter as Android studio I am not able to get the app in simulation. I am new to Flutter and Android studio (have a little knowledge of Xcode, 2 apps in the store) so I have looked at stackoverflow first to find a solution. All tried suggestions did not worked for me and I am hoping somebody can help me.
I have an original version of the project which was running in simulation mode. Now I am working in a duplicated version to find out how to get things up and running again. It worked before but why does Flutter or Android Studio give an error now? The folders and content do exist. Perhaps it is a simple thing to solve but it is not in my knowledge.
What to do to solve the error message I get as shown in the screendump?
The problem seems to be with the resources,
this should help.
Android Studio error: cannot resolve symbol in Xml
Or try to run "flutter clean" (usually solves many problems)
Flutter studio sometimes does not resolve those (no idea why).
Try opening the same Android project in Android studio and check it from there.
Once back, try File->Invalidate Caches/Restart
If they exist and the name is right (without extension), then it could be it.

Android Studio errors in files but project compiles and run

I have a problem. After I imported a project in Android Studio, in the activity java files it says "cannot resolve symbols" at certain lines, and they are with red, even though the project was fully valid before. The project has all necessary imports too, but some are with red too. The thing is that gradle build is working fine without errors and app launches in the emulator. I have tried invalidate cache and restart and sync gradle with project files. Do you have any ideas. ?
SOLUTION:
In build.gradle(Module: app) file, update the dependencies and sync.

Better to convert IntelliJ project to Gradle or to use Android Studio import project?

If you open an IntelliJ project in Android Studio, there is a warning that you should migrate to Gradle and it sends you to this link. This process seems a bit strange and complicating since the process is not well explained (it's more for experienced programmers who know how Gradle project looks like).
There is also a feature in Android Studio to import IntelliJ IDEA project. I did it with my project and it imported everything (except empty Proguard file), compiled well and all seems to work fine.
However, is this a valid process too - can I safely import future IDEA's project using import feature rather than the solution suggested by Android Studio?
Are there hidden dangers using this method? The least I would like it to continue coding newly imported Gradle-based project and at some point realize that the project is corrupted.
It should be fine. The projects it imports have their Gradle files properly set up, and if it works okay after import, there's nothing about the process by which it created that should make it stop working in the future. I think the link in that warning is just out of date.

Resources