Android Studio running Android (Java) Project as Flutter Project - android

Situation and Problem
I have been working with Android Projects using android studio for a while in Java. Recently, I have started learning Flutter and therefore added Flutter modules into Android Studio.
I opened both Android Project and Flutter Project at the same time in different windows and both project can share the same emulator, and everything seemed to work fine. Yet, the next day I opened the Android Project again, the WHOLE IDE was configured with Flutter settings. This means that:
1. Android Project is NOT synced with gradle, and thus all the imports failed marked red
2. All gradle related files are not visible in the project folder in Android Studio (still exists in folder)
3. All gradle operations are gone because the IDE is configured for Flutter. So there is no rebuild project/clean project/ sync with gradle files button
Things I have tried
Reopen the project
Invalidate cache and restart
Restart PC
But none of them seemed to work. If I tried to create a new Android Project, the new Android Project seems to work fine with all gradle operations available.
Android Studio Versions
Android Studio 3.4
JRE: 1.8.0_152-release-1343-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
I tried to look for similar issues but none seems to match this one. Any one can help?

I had a similar issue. Yesterday, I updated Android Studio to 3.6.1 and that fixed it. Try that.

I found the workaround solution is to import the project again instead of opening the project.
When importing, remember to choose opening it as an Android Gradle Project.

Related

Android View in Project tab of Android Studio keeps loading forever

Today I got my new Macbook and installed Android Studio. When I tried to open my Kotlin project, everything works perfectly but the Android project view is loading forever.
I created a new sample project and it loads correctly. I also have this project on a Win laptop and it loads fine too.
Does anyone have an idea why and how to fix this?
If you have just copied and pasted the project from your windows machine, you should expect some undefined behavior like this. Because there are some files included into the project specifically for windows OS. You should use git instead of copy pasting things. Or if you rather not at this point,
How to transfer an Android Studio Project from Windows to Mac OS X? Here is the files you need to delete to make things working on your mac.
SOLVED: I just uninstall the 4.1.3 version and use the beta version 4.2 rc1 and the problem is fixed.
Please delete
.idea
.gradle
files from project and then open project again.

Android studio IDE shows unresolved references / ignores imports, while builds are fine

Since couple of days I have problems with my android studio IDE, quite desperate at the moment. Various library imports are not recognized any more (some are, some not, junit e.g. isn´t), showing me unresolved reference error and autocompletion isn´t working as a consequence. But it´s only the IDE, gradle builds are fine.
Gradle files should be fine, the pic is from a new project where everything is set up properly. Same problem with old and new projects. I tried like everything already:
Deleting .idea folder + .iml files and reimporting the project
Invalidate Caches / Restart...
Deleting .android/cache
Deleting HOME/.gradle/caches
Downloaded and installed new Android Studio (v3.2.1), opened old, started new projects
Switched kotlin plugin versions, compilesdk versions, android gradle plugin versions, kotlin versions, gradle versions
I did couple of updates at the same time, Android Studio to 3.2.1, Kotlin plugin to 1.3.0, android gradle plugin to 3.2.1, installed newest sdk 28, switched from gradle 4.6 to 4.10.2. Shortly before, I had another weird behavior, where opened files didn´t show the real content but instead cryptic, binary symbols for nearly all the gradle or source files. Only deleting whole project folder and recloning it from git solved that one. I blame a hard reset while studio was running for that. As if anything android studio related on my machine is messed up. But even new installation of studio does not help
Ok, finally solved the problem by completely removing all android studio installations (using the included uninstall.exe), deleting HOME/.android and all HOME/.AndroidStudiox.x folders, then reinstalling android studio (not finding anything from previous installations anymore). Could then even reimport my settings, exported previously

Android Studio Stuck at opening Project?

I recently updated from Android Studio 2.0 to 2.1.2 and now I have a project which doesn't open. Android Studio is stuck at the following screen for more than 10-15min.
I tried solutions from these answers.[ans1] [ans2]
but none of them work.
I can create new projects and also import projects built on eclipse. But cannot open my own project.
Please help.
Delete the gradle folder in the project folder. It will work.
For many problems such as stuck with opening or downloading something while starting
I use this sequence as an ultimate guide and on one of the steps always works out.
Recently I used it after updating to 3.2
Try File -> Invalidate caches / Restart
Shutdown Android Studio
Remove .gradle folder in the user home directory
Start Android Studio (Studio will download gradle data)
After Gradle build is done, rebuild project
According to Android Studio's Known Issues https://developer.android.com/studio/known-issues under "Configuration on demand with Gradle 4.6 and above:", if you are using Android Gradle Plugin 3.0.x or 3.1.x with Gradle 4.6 and above you should add the following line to gradle.properties:
org.gradle.configureondemand = false
This seemed to solve my issue with Android Studio getting stuck at "Project setup: reading from cache".

Can't get Terminal Emulator for Android to build in Android Studio

I'm trying to build Terminal Emulator for Android. I'm running Android Studio 1.4 in Kubuntu 15.04. I also tried building it in Ubuntu 14.04 LTS with the same results. The project requires the latest Android NDK, SDK 22, and SDK 11 which I've downloaded and configured in Android Studio. My system gradle version is 2.8, and Android Studio has downloaded some other versions internally. I'm using jdk1.8.0_65, which is set to JAVA_HOME and configured in Android Studio. I've built several other projects with my configured Android Studio and only seem to have a problem with this project. I need to use this project as a base for an app I'm developing.
I end up with same error, posted below, no matter what route I take to fix it in Android Studio. This is generally what I've done to try and get the project to work. I open up the project unmodified in Android Studio. I click Build >> Rebuild Project. I get an error telling me ndk implementation is deprecated. I add a file gradle.properties to the root directory of the project with the line android.useDeprecatedNdk=true and rebuild. It gives me an error: Task 'generateDebugTestSources' not found in project. I execute Sync Project With Gradle Files to resolve it. Then I end up with the following error and can't get past it.
Gradle 'Android-Terminal-Emulator-master' project refresh failed
Error:exception during working with external system:
or
Gradle sync failed: exception during working with external system:
Consult IDE log for more details (Help | Show Log)
idea.log
Things I've done to try and get the project to build:
Modify all of the project's build.gradle files to use the experimental plugin
Use different versions of Android Studio
Switch from openjdk to Oracle's jdk
Upgrade gradle to the latest version
Set gradle to default wrapper (default) and also set gradle to different versions
invalidate cache, remove ~/.gradle, and rebuild project
Make sure PATH includes the gradle and jdk bin directories and is in ~/.bashrc, ~/.profile, and ~/.zshrc
remove proguard from libtermexec library
reboot computer
I should note that the project builds without issue on the command line. I'd really like to get the project to build in Android Studio for development.
Install Arch and run Android Studio there.
I decided to try building Terminal Emulator on my Arch server, so I installed a xfce (Desktop Environment) and Android-Studio through pacman. I followed the same general path to get things setup, and the app built without issue.
The idea log Android Studio generated for the failed build on Windows and Ubuntu didn't point to any clear problem, even with --stacktrace enabled with gradle. I'm not going to waste my time figuring out why gradle doesn't want to build apps in Ubuntu or Windows.

Android Studio 0.5.8 freezes on importing new project

Android Studio 0.5.8 freezes when new project is imported.
This issue is observed only for "import project" and opening existing projects works fine.
Also for freezing projects the build executes successfully on the command line via the gradle wrapper
I am using Android studio 0.5.8 in a multiproject setup with gradle plugin 0.10
Just before the project freeze Android Support Repository related warning can be observed in Gradle sync window. Not sure if this is related to the freeze issue though.
I have the Android support repository correctly setup via the SDK manager and the project structure in Android studio points to the correct android sdk path.
I've logged a bug for this issue as well. Open Bug Logged
If someone has faced a similar issue, kindly advise (orz)

Categories

Resources