Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: how to import Android library project

I'm using Android Studio and I've never imported or referenced any external libraries before.

The library I'm trying to reference is this: https://code.google.com/p/afiledialog/

I went to File - Project Structure - Modules and added a new Module pointing to this project library. After that I have no idea how to get it to work in my app, and when following the basic info on the main page it asks me to add this to my manifest file:

<activity android:name="ar.com.daidalos.afiledialog.FileChooserActivity" />

However when I do that it reports that it cant find the package FileChooserActivity.

All help is appreciated.

EDIT: Here are the main errors:

Gradle: package ar.com.daidalos.afiledialog does not exist
Gradle: cannot find symbol class FileChooserDialog
Gradle: cannot find symbol class FileChooserDialog
like image 374
Linkandzelda Avatar asked Jul 30 '13 01:07

Linkandzelda


People also ask

How do I add a library project to Android Studio?

Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.

How do I copy one Android project to another?

Select your project then go to Refactor -> Copy... . Android Studio will ask you the new name and where you want to copy the project. Provide the same. After the copying is done, open your new project in Android Studio.

How do you download library on Android?

Just go to Maven central and download the libraries. For example, here is Volley. Just click the download JAR button. I would strongly recommend sticking with Gradle / Maven, though, to keep consistency with versions and appropriately handle additional dependencies for the libraries you want to download.

Where is the lib folder in Android Studio?

How to find the libs folder in Android Studio? If you are unable to find the libs folder in Android studio then open your android project in “Project” mode If the project is already opened in the “Android” mode. Then go to Your Project Name > app > libs and right-click on it and paste the downloaded JAR files.


1 Answers

Go back to Project Structure window where you added the new module. Click on your main module, go to Dependencies tab, click the plus icon and select Module Dependency.

like image 115
Androiderson Avatar answered Nov 15 '22 01:11

Androiderson