Empty Android folder when cloning Google samples - android

Whenever I clone a Google sample repository from Github, the Android project sidebar is completely empty (No app folder and an empty Gradle folder). I usually encounter this problem when Android Studio asks me to provide the Gradle Home path when importing. I would highly appreaciate any help regarding solving this problem.
Android studio 3.0 project with an empty Android folder view
E.g. cloning Android vision API Samples

When you are importing the project into Android Studio (like in the following picture), are you importing the entire Github repository or just a specific vision sample? You should be doing the latter.
Example of importing project into Android Studio
Let me know if that fixes the problem.

Related

Why "androidx.appcompat" and "android.support.v7" libraries are not compatible for some versions of Android Studio?

I made an android application using Android Studio during lectures at university. Then I uploaded the project to drive and when I got home, after I installed the latest Android Studio, I opened my project and almost every line of code was marked as libraries were not found.
I found that when developing on a computer I use android.support.v7.app.AppCompatActivity but it's not recognized at home. So I tried creating an empty project at home and I found it uses androidx.appcompat.app.AppCompatActivity.
A solution I tried, was to delete all imported libraries and then I let Android Studio to import what he needs, but it's stupid. I have to do that every time I switch the working station.
Why can't it be just one library? Is there other solution, not to re-import all the libraries?
Your problem is "uploaded the project to drive", that also saved the .idea folder where everything regarding the IDE and computer is stored. So you are opening a project on another computer with routes to your old computer. Solutions:
Close Android Studio and then delete the .idea and .gradle folder from the project, re-open it
File/Invalidate Cache and Restart
Recommended Solution Use a version control system like git. Android Studio does a pretty good job integrating with VCS. In the menus look for VCS/Enable Version Control Integration you need to install git previously and know how to use git.
There is another thing, the new AS version has a sync gradle icon, is an elefant with and arrow, sometimes big changes on gradle can go unnoticed so click it. There is also the usual, clean project or rebuild project.
The other part of the problem is: the different libraries. Androidx was introduced to consolidate in 1 library the support libraries. It is recommended to use it. If the latest version of Android Studio dont support it then you will have to, and also update the IDE on the other desktop
You can't mix AndroidX library with support library in modern android application development. support is already deprecated and AndroidX is future. So, migrate your existing project to AndroidX
With Android Studio 3.2 and higher, you can migrate an existing
project to AndroidX by selecting Refactor > Migrate to AndroidX from
the menu bar.
Check official documents for more information

Android Studio: Cant run cloned github project with samples because I am missing a gradle

I cloned this repository from github and opened it as a new project.
The project view shows no gradle and I cant run the provided samples.
How can I create or add a gradle to the project and run the samples?
The repository directory what you have mentioned is not an android project.
This is the URL for that wheel sample
Android-Wheel-Menu
and also it is developed in Eclipse. So better download it from browser. then load it from Android STUDIO.
What you cloned is not an Android application but a library for Android applications. Thus, it's not intended to be run standalone which is why you don't find a build.gradle. You need to create a new Android project and then follow the steps under "Usage" which explain how to integrate it in a project.
This library is marked as deprecated, so you might want consider using another one.

Is there any way to Know the Project is build in Eclipse or Android Studio?

I Would like to know is there any way to know the project is build in Eclipse or Android Studio.Let's say I have one project how can i know this is build in Eclipse or Android Studio.
Detail Description :
I Download one apk form Play Store and I get the source code like below image format.
Any Help be Appreciated. I Search lot of thing but doesn't work me.
The project from your screenshot is built in Android Studio. The highlighted .iml file is an IntelliJ IDEA project file and Android Studio is based on IntelliJ IDEA. Moreover it looks like a Gradle project - there is a gradle folder and gradlew script, which is usually another sign of using Android Studio.

What to do with GitHub repository for Android app after switching from Eclipse to Android Studio?

I recently switched to Android Studio from Eclipse for the development of my Android app. Previously, I just had my entire project folder on GitHub, but now that I've switched to Android Studio, everything has changed!
What should I do with my existing GitHub repository? I still have both project folders on my computer. Is there some way to just update the most important files (.java, .xml)? Or should I just make a new repository?
Please, check this article to understand how to migrate eclipse project to android studio project:
https://developer.android.com/sdk/installing/migrate.html
You don't need to make changes in your github repo.

Can anyone helpme to set up HoloEverywhere on android studio

I followed the tutorial from HoloEverywhere in the Git page:
Android Studio / IntelliJ IDEA
Checkout from Version Control - Git
Typo in Repository URL: https://github.com/Prototik/HoloEverywhere.git
Press 'Clone', wait until repository checkout
If you use Android Studio, then just click 'Yes' on the proposal to open a project. Otherwise in IDEA press Import project and specify path to downloaded repo, choose gradle model and press next.
Mark checkbox Use auto-import and click finish.
Kiss a Google and Android devs team!
Read this basic migration guide.
But I canĀ“t make it work. I try to use the same method like ABS, but it doesn't work.
Any suggestions to make it work?
Actually, it's quite easy. Just download the source code. Use Android Studio to import HoloEverywhere project by selecting the build.gradle file in the root folder and you are all set. Android Studio will build it automatically. If you want to run, then you have to setup Android Studio to do so, you can refer to Android Studio documentation.

Categories

Resources