How to import android studio project from Github? - android-studio

I am trying to import this project from github Kotlin-Bluetooth. Whenever I try to import the project I am met with a list of errors. Am I doing something wrong or is this normal?
I have been importing the file by hitting New>Project from Version Control... Then in the URL field I paste the following link: https://github.com/appsinthesky/Kotlin-Bluetooth.git. After this I am met with a list of errors. I have gone through trying to fix them one by one but it never stops. Am I importing the project incorrectly or do I need to continue trying to fix the errors?

Yes, your method is correct.
You should now try to resolve the errors.
Currently Android Studio has been upgraded a lot, projects created with Android Studio in previous versions are not compatible with the current version. So errors do occur, but they can be resolved.

Related

Import old project into Android Studio?

I am trying relentlessly to import this project into Android studio as part of my Udacity Android development courses. I tried everything from forking on GitHub and cloning it into my Android studio to changing the Gradle settings, the Java version, following the recommended settings by android studio, etc.
https://github.com/udacity/ud839_CustomAdapter_Example
Nothing seems to be working. I keep getting errors. Each time I fix the error I get another error. Can someone please guide me as to what exactly is the proper procedure for importing an older project into the android setting and updating the settings? I seem to be experiencing the same issue every time I am completing online courses. The existing projects appear to be completed through older versions of Java and Android studio. Any help is greatly appreciated.
Thank you

Importing code from github to Android Studio errors

So I tried to import code from a github repository into Android Studio. I used VCS and everything went fine, no errors at all. But when I went to MainActivity.java it says cannot resolve symbol 'R' in this line setContentView(R.layout.activity_main);
I already checked the xml files and found no errors, as well as ran gradle cleans and builds. That didn't do it.
Thanks for your help.
So as you are saying, cleaning and rebuilding didn't help it. You might want to maybe upgrade/downgrade your gradle build version or try to copy it in again, since sometimes when copying errors occur for no outer reason.

Issue with creating windows 10 UAP project visual studio 2015

I have created a sample win10 Universal.
Initially project was created but its showing some reference missing error like
CS0246 The type or namespace name missing
When I close the visual studio and re open the same project the solution is not able to load the project.
when I tried to reload the project its asking for me to install some missing platform sdk, When I press on the install, initially I goes to this link.
but I think since its not available its loading some default page.
I am not able to find what to install?
can any help on this?
Thanks.!
I am also having an issue something like this.I tried the below things and finally got worked.
You can try out this work around.
First uninstall your windows 10.
Download the latest technical preview from here.
Follow this instructions.

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.

Android Studio: disabling "External build" to display error output create duplicate class errors

I am starting my migration from Eclipse to Android Studio, and start playing with new projects on Studio.
My test project was working fine till I got some errors messages.
I had to do some manipulation (https://stackoverflow.com/a/16876993/327402) to enable the error output to display, and found the issue that I fixed.
Unfortunately, after this "workaround" (Why the hell have I to make such things to see my errors?), I found that there was an error message that I cannot fix:
error: duplicate class: com.mypackage.name.BuildConfig
error: duplicate class: com.mypackage.name.R
I also noticed that I am not the only one to have this issue (see the comment in the SO answer I linked above)
First time, I was able to fix it by enabling "External build" again, but that happened again, because I needed to see the error output and everything is now broken, and I cannot find what happen.
With Eclipse, the R file was easy to find, in the gen folder, but with Android Studio, there are too many files, and I am a little bit lost.
Any idea/suggestion?
I've found a question like this that has some replies here:
Cannot resolve R.java, duplicate class
You can try this:
Delete the Build folder generated by Android Studio automatically
Also you can try to Rebuild project by clicking Build->Rebuild project after deleting build folder.
So, just to let you know...
A few minutes after I posted my question, Google released an update to Android Studio (0.1.5)
See link: https://plus.google.com/+AndroidDevelopers/posts/Y9vhvGaHCbh
Tor Norbye kindly answered my question in this community, and I am sharing here
So the workaround I quoted in the OP is no more mandatory.
Enabling again External build after upgrading Android Sudio let me see the real errors ( a library and some Gradle import that I fixed)
So, I consider the Android Studio upgrade as the best answer to this question...
Ok, I also have the same problem, and this is what worked for me.
I first unticked external build from compiler settings. Then when I compiled i get two errors related to R.java, duplicate class.
Then i delete the build folder manually from finder. Then rebuild it from android studio, but still same error.
Then I again go back to compiler preference and tick the external build setting, and it worked fine after that.
Looks like some bug.
apparently, or at least for me 0.1.5 has a bug and cannot run in external build
because of some path error you can read about here
https://code.google.com/p/android/issues/detail?id=56628
so i switched to internal building, and then i hit the double R symbol bug
after deleting the build path application is compiled without errors but the build folder is not fully rebuilt, I'm missing the R.java file which the internal builder does not make.
i've rebuilt it on the external builder on an unupdated version as a temp workaround while this issues is fixed.
btw if anyone knows how to tell internal gradle to rebuild the build folder please share.
I just had the same problem and found a way to solve it (You can do this with Android Studio open):
Go to you Android Studio projects folder located in c:\users[USERNAME]\AndroidStudioProjects
Locate your project folder and open it.
Delete the folder named build.
From here, enter your application name folder, where you can find another build folder among with libs and src folders and a file named build.gradle.
RENAME the build folder to build2 or something else.
Now in Android Studio go to Build->Rebuild Project.
And after the project was rebuilt, open again the folder where the build2 folder that you renamed is located.
Delete the new folder named build that was created.
Rename your build2 folder to build again.
Done.

Resources