Can't import library project into Android Studio project - android

I'm writing a library project to create a component that's going to be used in some, if not all, of our projects. I wanted to test how it's going so far, but I can't import the library project into my other project.
So, I created my library project called SplashScreen with Android Studio. Now I've created the project SplashScreenDemo with an Activity that should use the component I wrote in the library project. But the import wizard doesn't let me choose the project and all the info I find online is to import into Android Studio your old Eclipse library project, but in my problem Eclipse isn't involved at all.
So far I've tried:
Right click on project root > New > Module > Import Existing Project
File > Import Project
File > Import Module
This is the window (and that's the path to my library project):
I've tried several paths, none of them working:
/Users/dgc/AndroidStudioProjects/SplashScreen
/Users/dgc/AndroidStudioProjects/SplashScreen/SplashScreen.iml
/Users/dgc/AndroidStudioProjects/SplashScreen/build.gradle
/Users/dgc/AndroidStudioProjects/SplashScreen/app
/Users/dgc/AndroidStudioProjects/SplashScreen/app/app.iml
/Users/dgc/AndroidStudioProjects/SplashScreen/app/build.gradle
Any ideas? Am I missing something?
P.S.: Versions:
Android Studio 0.6.1
gradle 1.10
Android plugin 0.11.+

I think what's happening is that you're trying to import a module that has the same name as an existing module and it's not giving you any indication of what's wrong. Actually, if you enter just the path to the parent project so it will show you a list of modules you can import, and those modules can't be selected if you hover over one, it will show you the error message in a tooltip:
Obviously that's not very helpful, and I've filed a bug asking for improvements:
https://code.google.com/p/android/issues/detail?id=71942
To work around it, you'll have to rename either the module you're trying to import or the module in your project. To do that you can right-click on it in project view, choose Refactor > Rename > Rename directory.

Related

Android Studio won't import Porcupine project

When I do File > New > Import Module and select the porcupinemanager module, which looks like this:
It tells me it also needs to import the module called porcupine (which i don't know where it is).
I get an empty directory in my Android Studio project:
This gets added into my settings.gradle:
include ':app', ':porcupine'
I still can't access any of the classes.
In settings.gradle ':porcupine' is there, even though porcupine doesn't exist.
How do I import this library properly? Here's the repo:
https://github.com/Picovoice/Porcupine
import the whole project from outside folder or add sdk tools
It seems the issue is with the Android Plugin Version under Project Structure --> Project might be different to the version of your plugins all used. Once you align them to the same version, you could see all your classes from your imported module.
I had the same issue. Depending on what you want to achieve, you have to import either the Activity or the Service directory.

AndroidBootstrap could not be found

How to solve it when I import eclipse project into my android studio
Image to understand issue
Edit 1:
Import Eclipse Project to Android Studio:
Start Android Studio and close any open Android Studio projects.
From the Android Studio menu click File > New > Import Project.
Alternatively, from the Welcome screen, click Import project (Eclipse ADT, Gradle, etc.).
Select the Eclipse ADT project folder with the AndroidManifest.xml file and click Ok.
Select the destination folder and click Next.
Select the import options and click Finish.
The import process prompts you to migrate any library and project dependencies to Android Studio, and add the dependency declarations to the build.gradle file.
For detail description try this link
https://developer.android.com/studio/intro/migrate.html#migrating_from_eclipse
Edit2:
Well, there might be another way of solving this problem, but I ended up removing the line in the project.properties file that was making reference to the Android Bootstrap library.

How to add library project to an existing android project in AndroidStudio

how can I add a custom library project (in my example the CuXtomCam library) to an existing android project using Android Studio 1.1?
I've read about changing the build.gradle file. But where should I place the library ressources?
Thank you in advance for all answers and comments!
To import library into Android Studio:
select File > Import, and then select the directory containing the project to import.
a wizard will open and guide you through the rest of the import process.
When the project import has finished, it will open up a file called "import-summary.txt" which lists all the steps taken during import and suggestions for next steps. For example, it may note files that were not migrated, it may note missing components in your SDK install, and so on.
Just right click on the project then New>Module. from the new window select Import existing project. Give the directory. I think this will help

Android studio import module button missing

I've got a long history with Eclipse, but I wanted to try Android Studio. So I created new project and now I want to add SlidingMenu library to it. I found some tutorials whose say to go to Project structure, click plus button and select Import module.
But there is no Import module option, when I click plus then New Module window pops up. I'm currenty using Android studio v0.3.6. Is now proccess to import module different?
Thanks
The Import Module feature has been removed for Gradle-based projects because it previously didn't do the right thing with your Gradle build files and it would put your project in a confusing state; it will be re-enabled when it's properly implemented. The bug tracking it is at https://code.google.com/p/android/issues/detail?id=62122.
In the meantime, to add a module, you need to write a build.gradle file for it by hand, add a reference to the module to your settings.gradle file, and if the project is still open in Android Studio after you make the changes, click on the "Sync Project with Gradle Files" button in the toolbar.
If you're not familiar with Gradle, you can get docs on the particulars of Android Gradle projects at http://tools.android.com/tech-docs/new-build-system/user-guide.

Why can't android projects be imported into eclipse?

I have a root directory with a number of android eclipse projects inside. They all have .project files, but eclipse does not seem to see them as eclipse projects? Does anyone know the reason why?
Cause for not importing projects in eclipse :
Reason 1 : Project Structure Differs
Reason 2 : Project Configuration files missing or not available
Reason 3 : Project can be already exists in workspace
Reason 4 : Don't have Proper and Standard Naming Convention
Follow these steps.
Hope you have android sdk and ADT plugin for eclipse.
File-->Import-->Android-->Existing Android code into workspace.
Then import the projects from your root directory using Browse button. If you don't have ADT plugin definitely you never import your android projects.
You have to import them manually
First File > Import
Then General > Existing Project Into Workspace
Either select root directory or Select archive file, click Browse to locate the directory or file containing the project that you want to import
Under Projects select the project that you want to import
Finally click finish to import the project
Here is a link to the eclipse help section on this
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-importproject.htm

Categories

Resources