Android Studio 3.0 - Cannot load any Android projects - android

I updated to the latest Android Studio 3.0 version, and no matter what I do I cannot get a project to be properly recognized by Android Studio.
For one, Android Studio projects typically have the Android Studio icon instead of the typical folder icon in the file system, when browsing for a new project to open.
For two, this is what my project structure looks like - no modules, and I also cannot select "android" view instead of "project".
For three, I cannot run, build, or clean the project at all.
Sometimes when I open a project I get this error:
And sometimes that error doesn't show up at all.
Has anyone encountered this? I'm tried uninstalling Android Studio and re-installing it, installing the new 3.1 Canary 3 version, the stable version, nothing works. I've deleted and recloned every repository - I've tried many, big and small, and none work. I can compile fine from the command line though.
Many of these repos are used by other people currently using Android 3.0 stable and 3.0 Canary 3, and I'm the only one having issues, so I'm very certain it's not a repository issue. And if it is, I probably am not allowed to make whatever changes would be needed to fix this issue.

Related

Android Studio: Inline compiler showing red errors only for Flavor specific Kotlin files, but compilation with gradle works fine

I know similar questions exist already. But my case seems different. I have these inline compiler error ONLY in the files that are Flavor specific; added in "...\src\myFlavor\...". And even the basic classes are not found, check the image attached in the end. When I run the app, it compiles and runs fine.
I have tried these steps already:
File > Invalidate Cache/Restart > Invalidate and Restart
Delete two files .gradle and .idea
Remove dependency which is showing error & Sync. Again add dependency & Sync.
I even did a fresh install of Android Studio on another laptop and pulled my code there. Nothing resolves this.
I have more than 5 flavors in my app.
I am using the following versions of gradle, kotlin and Android studio.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
api "org.jetbrains.kotlin:kotlin-stdlib:1.7.20"
Android Studio: Dolphin | 2021.3.1 Patch 1
This issue is old, I was living with it. So now I added this question here. Please help me with it. It makes development very hard on these files.
I reported the issue and Android team guided me.
I installed Android Studio Flamingo and the issue got resolved.
I didnt know there was a new version out there cz I used to "check for updates" and it said u have the latest version.

Android Studio Doesn't Load the Preview Layout with no Error

Android Studio Doesn't Load the Preview Layout and there's no Error! but when I open an old project it loads that projects layouts.
I tried the older build tools and I also delete cache and stuff like that, I even removed entire android studio and reinstalled but it didn't fix it.
It seems to be happening since the fresh Windows 10 that I installed recently, and the the Android Studio V3.1.3.
Any solution?

Android studio - no launch to last version of app and no project structure

In android studio, I had a project that was working in first place but then I created multiple copy of it in other paths to add changes to these copies instead of the original.
Afterwards, I noticed that the emulator shows up but doesn't launch the app I am trying to run. I followed a tutorial on YouTube that opens the setting app on the emulator and clears launcher data. then nothing changed.. I noticed that no matter how many changes I am adding to the file, nothing changes in the old app icon existing on the emulator.
Things got much worse later when I noticed that there is no modules or any other folders in the project structure except the SDK and when the older project versions were found to have same problem suddenly.
Even when I create a new project that is empty, same thing happens and the app crashes once it's installed.
Android app icon button before run appears in the project with a red cross over it.
Both the emulator and the mobile device don't get the latest version of the app I am trying to install.
I tried to make project, build, run, clean project, sync with gradle file, invalidate cache & restart. However, none of these solutions seem to work.
No idea what is going on.. things seem to be messed up and all online sources seem to be less useless to me.
Note: I am using Android studio V 1.1.0
so, I found that the best solution to this problem is to uninstall the current version of Android studio and SDK folder and reinstall it from scratch.. hope that helps

Android Studio not recognizing classes after power failure

A co-worker is having this problem for second time with Android Studio (first time he just got tired and reinstalled Windows)
After a power failure while using Android Studio on Windows 7, it couldn't resolve symbols for all android classes anymore. SDK and JDK seem well configured and we even downgraded to JDK 7u75 in order to discard that he originally installed JDK 8.
SDK Manager works and shows all needed APIs installed.
When creating a new project it comes with the same problem and reinstalling Android Studio doesn't help either. When exporting the project and testing it in another computer it works correctly.
What could it be?
Android Studio caches a lot of details that won't be fixed by simply running a clean/rebuild on your code.
When facing any issues like this the first thing to do is often go to File -> Invalidate Cache/Restart and perform a full cache drop and restart.

Eclipse/Android can't generate R files for any project

I am a new Android developer (4 weeks into porting my iPhone app to Android). I have 8 projects (the app, and 6 small UI experiments, and a vanilla Hello World project that I just created with Eclipse). All fail to compile, and the issue is that every reference to the generated file R is flagged as "R cannot be resolved to a variable".
Up until yesterday afternoon -- every project compiled and ran (albeit very slowly) in the Android emulator. I've changed something, and since yesterday, all projects fail to compile, all in the exact same manner "R cannot be resolved to a variable". I every case, the generated files are missing. I believe they disappeared as I tried to clean and rebuild each project in the course of debugging this problem.
Two things that I know changed when this problem started, but that I can't say caused the problem, were: 1) shifting to debugging on a real Android device (a Samsung Galaxy Tab 2, which worked like a champ after struggling with the slow emulators), and 2) allowing Android (and perhaps Eclipse) to update themselves from the web.
I've spent many hours trying other user's suggestions and none have helped. Most suggestions refer to file naming issues, xml syntax errors, but I haven't changed these files and filenames since compilation was working. I have tried:
cleaning and rebuilding the projects
checking for subsequent updates to the Android SDK (and there were 2 subsequent ones)
Eclipse->File->Android Tools->Fix Project Properties
making small source changes to force rebuilding
rebooting Eclipse, as well as the Mac host, adb, the emulator, the Android SDK Manager
deleting a project, restarting Eclipse, and adding the project back in (bad idea - this fails with an error "Failed to load properties file for project 'ListViewFragmentTest'"
creating a brand new Android App project, which has worked many times before, but now fails
There's something going systematically wrong, and while I won't claim all these projects are bug-free, they did run up until 6pm yesterday, and then all stopped compiling thereafter.
I wonder if anyone has other suggestions, before I embarking with a complete reinstall of the development environment?
My environment is:
Macbook Pro (OS X 10.7.5, 8GB RAM, 2.53GHx Core i5)
Eclipse (Indigo Service Release 2, Build: 20120216-1857) (too old?)
Android SDK Manager Rev 22
Android SDK Tools (22), Platform Tools (17), Build Tools (17)
API's 11-17, all up-to-date
Seems like lots of people experience trouble with missing generated files (R), and I have had trouble when I've had layout XML errors as well, but that doesn't seem to be causing this problem. Thanks in advance for your help!
I am not sure but you are facing issue of R.java file is not getting generated after updated with ADT rev 22.
If this is the case then here is the solution:
Hope you know Android studio has gradle building tool. Same as in eclipse they have given new component in the Tools folder called Android SDK Build-tools that needs to be installed. Open the Android SDK Manager, select the newly added build tools, install it, restart the SDK Manager after the update.
Check in the Java build path library, whether "src" check box is checked or not.
If you are using any additional Libraries then make sure libs/android-support-v4.jar is same for project as well as the Libraries.
Thanks everyone. None of these suggestions resolved my problem. And while I'm curious as to why it happened, I was more impatient with not making any progress. I've reloaded Eclipse and the Android tools (this time with the bundled version from developer.android.com), and everything is working smoothly again.

Categories

Resources