How to add android studio project in same repo on github - android

When I uploaded a project on github, it automatically created a new repo with the project name. Now, I want to add another project on my repo. The thing is I want all of my android projects on the same repo. How do I do this?
The new project I want to add is throwing me error like "remote with selected name already exists".
The github error when trying to push.
EDIT:
Now when I created a folder in my system and tried uploaded it using this link, some of my projects aren't opening.
What's this? Any help is widely appreciated!!!

Right way todo this. follow these sample steps or you can add it manually
Check out git repo and open it in Android Studio.
Choose Import Module from File > New
Copy your project folder path and past into source directory: click finish that you want to add in existing repo. This will allow you to switch between projects right from Android Studio.
Commit and push your code.
Note: Make sure you don't have app with same name. by default it says app

You cannot upload all projects on the same repo. You have to do it manually.
or you can make a folder and then place all your projects inside it.

You can't create two repositories with the same name. If you want to put all your projects in same repository, you could either create separate directories under same git or , you could create separate branches.

Related

GitHub connecting to an existing project with Android Studio

I want to create a repository which my coworker will push his project files into it. When we tried this he did not know how to do it without firstly pulling the existing files which I was created before. But we don't want them. How can he replace his project files over my existing repository files?
It is possible and you can do it like this:
First configure AS so that you share the same repository
Then:
and finally
In order to replace your files you are working on simply synchronize and commit files!
You (or your coworker) will have to manually remove the files (then commit and push the removals) you don't want. You can do the removal before your coworker clones the repository.

Flutter dependency in java plugin

I have opened android plugin of Firebase Auth but I cannot access flutter dependencies. What can I do to be able to use features like autocomplete?
When I run the code, everything works fine.
Alright, there is an easy solution for that!
Open Android studio and open the map viewer and make sure you are in the Project view.
Now create a new directory and call it something like tmplibs.
Alright, now navigate to your Flutter SDK directory. So where you cloned the Flutter repo. Then open the bin folder, after that the cache folder, followed by the artifacts folder, now open the engine folder and finally open the android-x64 folder.
So the path will look something like this:
...\flutter\bin\cache\artifacts\engine\android-x64
In here, you'll find a file called flutter.jar. Copy that and paste it in your new tmplibs folder!
Now right click on the flutter.jar file in project view in Android studio and click on Add As Library...
Now open your module settings
Finally click on Dependencies and changes the scope of tmplibs/flutter.jar to provided.
That's it!
A better solution is to use the android project of the example app instead of the library. See this issue response on github: https://github.com/flutter/flutter/issues/11632
Bram Vanbilsen's solution resolves the problem. But comment the implementation line in build.gradle file after building the plugin.
dependencies {
implementation files('tmplibs/flutter.jar')
}
If you run the example app without commenting the above line, it produces Duplicate dependencies error as the flutter source is included in the example app's build.gradle file.

Migrating SVN to Android Studio

I'm migrating my Android project from Eclipse to Android Studio. I use Subversion and am wondering how I can migrate my SVN to the new file structure used in Android Studio without losing my history.
Thanks for any help!
Posting this because it might help someone else.
I ran into the same problem as well. #user714965 was inspiring but didn't solve my problem because I couldn't figure out how to get SVN recognize that I moved a file from the original folder to the new structure in my working copy.
For the following, you will need TortoiseSVN or a similar SVN GUI client to do this.
Here is what I did:
Commit the Eclipse project last changes into the SVN repo.
Open Android Studio and use that to import the Eclipse project working copy.
Android Studio will nicely convert the Eclipse project into a Android Studio/Gradle project. Let's call this project "PrjGradle".
Open the converted Gradle project folder window and keep it one side of your screen
Go into your SVN repo where you have your project (using TortoiseSVN).
Backup your current trunk into a branch or a tag and call it "final_eclipse" or whatever.
Now, mirror the folder structure of the newly converted Gradle project on your local machine directly on the TortoiseSVN Repo Browser window. Meaning, look at how the directory is structured in "PrkGradle" and create/delete/rename folders directly on the trunk repository. This will be painstakingly tedious but you have to bear with it if you want to preserve your SVN history.
When you move files around (not copy) directly on the repo, the history of the files remain intact.
Once you complete, check out the restructured directory into your local machine. Let's call this "NewPrj".
Use a suitable Folder compare program (such as Beyond Compare) to synchronize missing items (such as build.gradle, .iml files, etc.)
Rename your converted project to "PrjGradle_old", and rename the newly checked out project (NewPrj) to "PrjGradle".
Open "PrjGradle" in Android Studio. That's it!
Hope it works out.
I don't know the differences of both file structures. But it would try it this way:
Check out your project (maybe better use a client like TortoiseSVN)
Build the new file structure (new folders)
Commit
Move the files from the old structure to the new
Commit (check the commit dialog if there are move actions only!)
Delete old folders which you don't need anymore
Commit
SVN will recognize these move operations. You will see if it works by the operations in the commit dialog. If there are "delete"/"new" actions something went wrong there should only be "move" actions.

Copy and past a app?

I finished a "base app" for all my next apps in eclipse, with admob, contact us...
Can i sort of import this project in a new app and work from there? Or just copy and paste everything and just change the name? How? Like just start a new app with every thing like that app and the work it out from there?
thanks
You can turn your base app into a Library project (see http://www.vogella.com/blog/2011/03/03/android-library-projects/) and your other apps will include this library.
One gotcha with this is that the AndroidManifest.xml from your library is ignored, so you may need to manually copy activities, services, etc. from your library manifest to the real manifest.
I would put my "base app" project in a code repository (git in my case), and then just clone it, change the output name, libs etc in any build scripts. Check that into a new repository and keep working from there.
If you don't use git/svn/whatever just copy your source files and create a new project in eclipse, it's probably easier and less error prone than copying the project files as well and trying to remember all the places that refer to your old project.
Might be a little off-topic but what I usually do is I have pure source (and some build scripts) in a code repository and then outside that (in my eclipse workspace) I create the eclipse project and link the source files into my project. So if I trigger builds with eclipse I get the build output in my project directory while keeping my source directory clean.

How to re-open closed Android project?

I am using Eclipse to develop Android projects. I tried to reopen a closed project but got the following message...
The project description file
(.project) for is missing. This
file contains important information
about the project. The project will
not function properly until this file
is restored.
I thought I could just create the project from my source folders (by using Windows Explorer) but the projects are completely gone (and I hadn't backed up to an external drive)
Any suggestions how to get these projects back?
closing a project does not delete the .project file. something else happened to delete that.
To "recover" from this situation I would do the following:
Create a new android project.
Close eclipse
Copy the source from the former project into the new project (outside of eclipse).
Start eclipse.
Refresh the new android project.
Is your source for your projects completely gone? Did you check your workspace location?
If you still have your source you can create a new project and copy your source into it. (do this via explorer)
You can also try copying a .project file from another project. After the project opens you can then right click on the project and select 'fix project properties'
use window/show view/Package Explore (Alt+Shift+ Q P)
then in Package Explore window select your project
next step project/open project
its take me long time to find it.

Categories

Resources