unable to run a cloned repo in android studio - android

I cloned a Beacon Library https://github.com/Codefy/onebeacon-android from github, it has some samples that i want to run, but as i cloned the repo my debug buttons become disabled.
The README file says that sample projects are ready to build, it would be really helpful if someone would explain how to run it.
i repeat that i want to run base service module on my deivce.
Thanks in advance.
Solution
It turned out that the right way to do was to :
(1) Open Android Studio, then File-> New -> import project -> select sample directory.
(2)Then fix the gradle issues.
(3) Select the specific module you want to run.

Create a new folder and open it using the terminal. Clone the GitHub repo using the terminal (git clone https://github.com/xxxxxxxxxx/xxxx.git). Then open it using the Android studio and you will be able to run it. I don't know how, but it worked for me.

Just Restart Your android Studio. It works for me.

Related

How to run kotlin app from android studio?

I cloned this repo onto my laptop: https://github.com/mozilla-mobile/focus-android
I then opened Android Studio and imported project. (imported the focus-android folder). But the run button right now is grayed out. I tried to edit configurations and launch the MainAcitvity.kt. Here were my configuration settings:
https://preview.redd.it/mdyg1vcvcxi41.png?width=1073&format=png&auto=webp&s=bdcf5f6f51d59c9b107b459a0e2fc76dd6db059f
but I cannot select a module and it says Error: Module not specified when I try to run it. How exactly do I launch an activity / run firefox focus through an emulator given the github repo?
Thanks in advance!
Here is a tuto to create a virtual device: https://developer.android.com/studio/run/managing-avds
PS: I just run the project to see, I did File > New > Import Project and it was working, here is a screen of what you should have https://i.stack.imgur.com/Nv5NN.png

Error with sharing Android Studio project with GitHub

So when I try to share my project with GitHub through Android Studio, it says I have done it successfully, and a new repository is created, but when I open the repository, it is empty. I'm pretty inexperienced with GitHub, and I have spent hours trying different things and I can't get it to work, so if someone could help point me in the right direction, I would be extremely appreciative.
Here are the steps for seamlessly working with Android Studio and github
Create a new project in Android Studio.
Create some files.
Go to VCS -> Enable Version Control Integration. Select git
Go to VCS -> Commit File and select all the files that you want to commit with a message.
Go to VCS -> Push.
Click on Define Remote.
Enter the url for the already created repository in github.
Click Push and enter the Github password.
P.S : I am using Android Studio version 1.5 If you are using some other version, then the steps can be a little different.
After creating Repository, you have to push/commit the source files to the server. It seems you have not committed any file yet.
You can use some other Git clients like Source Tree with GitHub

Getting GoogleCast to work

I've tried, with zero success so far, to both create a new project and add GoogleCast to it and to get the given examples to work on Android Studio (currently using 0.3.2, but will upgrade if needed) on MacOSX.
Migrating to Eclipse, however, is not a valid option at this time.
I always seem to end up stuck with some reference issue, either giving me the error "No resource found that matches the given name '#style/Theme.AppCompat'." or multiple compile-time errors related to having no idea where android.support.v7 is located at.
Tried many different solutions, such as removing the #style part that someone mentioned to work or setting the v7 path as relative.
Though I wasn't able to follow through with this last one, no idea how to actively do that in AS and not enough reputation to comment there.
Then I came up to this solution Anyone get the chromecast android examples working in android studio?, which seems like a good attempt, except I can't seem to find the mentioned GoogleCastSdkAndroid.jar anywhere, so I'm stuck.
Couldn't find a truly comprehensive tutorial anywhere either, since they all seem to have no issues whatsoever adding v7 to the project.
Thanks in advance for anyone who can donate some of their time to solving this issue.
EDIT:
After upgrading to 0.4.6 (is 0.5.1 stable already? Considered how fast it came after 0.5.0...doesn't sound too good); I did what Ali Naddaf suggested, but couple extra questions popped up:
I could build the CastVideos project and import it into Studio with no problem; however, the CastVideos project structure is radically different from a new project's structure (referred to as OtherApp from now on).
The main issue that pops up when I try to mimic CastVideos on OtherApp is that it doesn't find the CastCompanionLibrary project on the OtherApp only, which I can't seem to be able to figure out where exactly should be located at (I thought the 'core' folder was the one with AndroidManifest?).
Also, how do you import modules now? The Project Structure only allows the creation of new modules.
My suggestions:
update your Android Studio
open SDK manager and make sure you have the "Android Support Repository" installed
create an empty directory on your system (referred to it as <DIR> below)
change directory to <DIR> and clone CastCompanionLibrary-android to CastConpanionLibrary
$ cd <DIR>
$ git clone https://github.com/googlecast/CastCompanionLibrary-android.git CastCompanionLibrary
$ git clone https://github.com/googlecast/CastVideos-android.git CastVideos
first make sure all is fine by building from command line:
$ cd CastVideos
$ ./gradlew build
it should do a successful build at this point.
if all is fine, open your Android Studio and select "Import Project" and point to build.gradle in the CastVideos project.
Now for any other project, you can look at the build.gradle in CastCompanionLibrary or CastVideos to see how you can set up your dependencies on the support libraries; if you don't have dependency on the CastCompnionLibrary, then it is even easier.
You very much need to upgrade Android Studio. 0.3.2 is quite old and a multitude of bugs have been fixed since then that are almost certainly affecting you.
Other than that, make sure you have the Android Support Repository installed in your SDK Manager. Between those two it should solve your support.v7 errors and #style/Theme.AppCompat issues.
This question is very old but to make it work I had to clone both Git repositories (CastCompanionLibrary & CastVideos-android). Import CCL into Android Studio as Non Android Studio Project, change the version of build tools to current 21.1.10, build the project and close it. Android Studio asked me to reopen the project. Hit yes. Do exactly the same with CastVideos-android and finally I could launch it into my smartphone.
Was really painful, took me 2 hours make sense of the error, because I was trying to open into Android Studio like Android Studio projects (they were) but there was a problem with the .idea file.
Tried this and everything worked.

Android Facebook SDK samples : 'your project Contains error(s), please fix them before running your application'

I am trying to learn Facebook integration to Android Apps. In the process, I followed the tutorial as explained here. I have a little knowledge on Android, but nothing on integrating Facebook to apps.
I have my Android Workspace in a different path (not the same as my Android SDK), in my Windows computer. I have added the Facebook SDK library to my workspace, and loaded a few sample examples from there - as explained in the above tutorial.
Everytime I try to build and run any of the Facebook samples, I get into the problem 'your project Contains error(s), please fix them before running your application'.
When I goto my Problems View, I can see 1 error -> 'Error generating final archive : {Workspace-Location}\libs does not exist'.
I went through a few related questions on this, and I have tried the following :
Clean the project & rebuild
Remove Automatic Building, and close eclipse, then restart, then clean, build & run
go to .debug folder(under C:/USER/.android/), remove the debug.keystore, to generate new key
ensure in android properties, the uncheck on 'is library' is obeyed.
All of the above has not helped me. I am stuck for more than a day, and internet search is not helping me.
I would be happy if someone can help me here.
delete the libs folder solve this problem for me
you could add libs folder back as below:

Building Android default email client: No default.properties exists? (Also, build path errors)

I'm just trying to build the default Android email client, the source is located here:
https://android.googlesource.com/platform/packages/apps/Email
I cloned the git repository, imported it into Eclipse, but Eclipse groans that default.properties doesn't exist. How do I generate default.properties and fix the build paths for this particular application?
EDIT: I hope I don't sound too demanding here, but there might be some special requirement for this particular application, since I've cloned so many other applications and built them successfully, so before replying if you could clone this repo and try building it yourself, that would be swell.
EDIT2: I also tried running this:
android update project -p . -t 3 -s
in the project directory, which generated the missing files, but now the project inside Eclipse is riddled with hundreds of errors:
Screenshot
I think the problem is that you're trying to import an existing project. Maybe try creating project from source, i.e. create a new android project and specify the location of the source. Eclipse will then create all the necessary files for you, including default.properties.
This file is auto-generated, so you shouldn't have to create it yourself (and if you do, it might get overwritten anyway). Try setting the android library to make eclipse rebuild your project.
This is located at "Project Root->properties->Android.
See which android version is being used and change it to a new one. Then change it back after eclipse has re-build the project for you.

Categories

Resources