w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Adding module library to android studio via gradle
Add something like this in your build.gradle repositories { mavenCentral() } dependencies { compile 'com.viewpagerindicator:library:2.4.1' compile 'com.google.android:support-v4:r7' //transitive dependency of viewpagerindicator } From the viewPageIndicator project page : This project depends on the ViewPager class which is available in the Android Support Library or ActionBarSherlock. Details for including one of those libraries is available on their respecitve web sites. That's why I added the support lib in the dependencies (you may need another version)

Categories : Android

Android Studio IDE unable to refer to classes from a library module
If you are trying to add a library, go to File -> Project Structure -> Libraries -> click + then add the jar. Once it has been added, it will ask you for the module which is dependent on jar. Select ProjectA from the list. That should link the library to Module.

Categories : Android

Android Studio - Build an Android project with Android library which depends on another Android Library
The manifest files for the library must currently have a <application /> node, even if it's empty. It's a restriction we'll remove at some point but for now, just add it.

Categories : Android

Send plain text from an Android library to an Android project
You could achieve this communication with the aid of interfaces. The idea is to crate a callback method that will be implemented in your activity, and will be called by the project library to send text back to you (in android project). For example, create an interface: public interface OnTaskFinishedListener(){ void onTaskFinished(String text); } Let assume that in your project library you have a class named Task with a method doTask() that you use in your Android project to perform some task and then send the result back to you. Then the implementation of Task will look like this: public class Task{ // ...... public void doTask(OnTaskFinishedListener listener){ // Do the task... String textToSend = // some text to send to caller activity listener.onTask

Categories : Android

How do I add the library android-support-v7 in IntelliJ IDEA (Not Android Studio/Gradle)?
You just need to add "@string/abc_action_mode_done" in your appcompat/res/values/strings.Do not "set mediarouter as a dependency for appcompat library".(In my case,"@string/abc_action_mode_done" already exists in the appcompat/res/values/strings.I don't know why you miss it.) "add depenency appcompat to mediarouter" is necessary.

Categories : Android

How to setup and test an Android Library Project with Gradle and Android-Studio?
i think this tutorial will help you : http://cyrilmottier.com/2013/06/27/a-productive-android-development-environment/ !

Categories : Java

Maven repository and "Android support library", revision 18 for Android Studio 0.2.x
Install fresh Android Studio 0.2.x. Upgrade from pre 0.2 doesn't work as mentioned here http://developer.android.com/sdk/installing/studio.html#Updating Reason is that new Android Studio is shipped with maven repo for serving support libraries. Alternatively edit build.gradle and replace compile 'com.android.support:support-v4:13.0.+' with compile files('/libs/android-support-v4.jar') then copy support jar to libs folder.

Categories : Android

Android Studio - Export Android library aar with pure gradle
You should try updating/upgrading your build tools and gradle through AndroidStudio. Once you do this, or if you have already done it, you should be able to modify your build file to reflect the updates: classpath 'com.android.tools.build:gradle:0.5.+' ... buildToolsVersion "18.0.1" NOTE: I am still unable to generate aar files even with this setup, although compiling is fine. At least this might get you past this hurdle.

Categories : Android

Android Studio: Plugin with id 'android-library' not found
Instruct Gradle to download Android plugin from Maven Central repository. You do it by pasting the following code at the beginning of the Gradle build file: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:1.1.1' } } Replace version string 1.0.+ with the latest version. Released versions of Gradle plugin can be found in official Maven Repository or on MVNRepository artifact search.

Categories : Gradle

Android Studio: how to import Android library project
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.

Categories : Android

How to compile Android native library with Android Studio?
NDK integration is very basic, limited, and not documented (per the New Build System page) at the time of this writing. There a couple of examples in the samples at the bottom of that page that illustrate how this can be done. You can also check the Gradle Plugin User Guide periodically to see if any additional documentation is available.

Categories : Android

Creating a new Android Library in Android Studio
Updated my Android Studio today and guess what, it's fixed! So anyone who has this problem just update asap. Tried this on Mac and Windows and it now works on both. PS: I'm on version 0.2.6 now (version of august 24). Guess I was one day too early with the question :P

Categories : Android

Android Studio & Gradle: Add outside java classes to Android main project
you might want to make your Dir a own module add include 'Dir' to your settings.gradle create a build.gradle inside your Dir directory with this content apply plugin: java now you can go into your main projects build.gradle and add to dependencies: compile project(':Dir') if your Dir uses android related stuff, you might want to use the New > Module(right click on your project in Android Studio) Function of Android Studio to create an Android Library. But i haven't tested that feature yet. If Android Studio throws an Exception when trying to use the New Module, you should try to update Android Studio, in the latest Version it works for me. You might also want to check the Gradle User Guide and the DSL Reference both are very helpfull in getting into Gradle and understanding i

Categories : Java

Android studio: new project vs new module
From the documentation (Android Studio is based on Intellij IDEA) : Whatever you do in IntelliJ IDEA, you do that in the context of a project. A project is an organizational unit that represents a complete software solution. Your finished product may be decomposed into a series of discrete, isolated modules, but it's a project definition that brings them together and ties them into a greater whole. For Android, it means one project per app, and one module per library and per test app. There are multiple issues if you try to build multiple apps within the same project. It's possible, but if you try (like I did), you will see that almost everything is designed to work with a single app per project. For example, there is an option to "rebuild the project", which makes n

Categories : Android

Add library in Android Studio 0.2.8
You should go in file - project structure - modules.. this is correct. At the top of the second column, click the + sign and select New module if you are creating a new library from scratch or Import module if you already have the library.

Categories : Android

Where is "Create Test Module" in Android Studio?
You can put them in the same module as the sources of your apk. Create a directory structure like this: -<Project root> |-<Module name> |-src |-main |-com |-<company name> |-<app name> |-instrumentTest |-com |-<company name> |-<app name> <- Put your unittests here You can run them by create a new run configuration in Android Studio. Select a new Android Test run.

Categories : Android

Appcompat / add a library with android studio
You should have two dependencies: dependencies { compile 'com.android.support:support-v4:18.0.+' compile 'com.android.support:appcompat-v7:18.0.+' } Verify that you have downloaded the latest Android Support Library and Support Repository within your SDK manager. http://developer.android.com/tools/support-library/setup.html#download Detailed tutorial on setting up the ActionBarActivity: http://www.blackcj.com/blog/2013/08/14/actionbar-with-android-support-library-r18/

Categories : Android

Importing library in Android Studio
Put the jar into the libs folder Right click it and hit 'Add as library' Ensure that compile files('libs/~~~~~~~~.jar') is in your build.gradle file Do a clean build (You can do this easily in android studio but just as a better method, go to your project folder using windows explorer and open a Command window there by right clicking the folder while holding shift and type gradlew build.

Categories : Android

How can I import library at android-studio?
Android Studio uses Gradle for building. Version 2.2 should pick up all libraries specified in build.gradle file. However, If you change anything in Project Structure dialog it won't update build.gradle file. Open -project_root -module_root build.gradle This file should NOT be empty. There is another empty build.gradle in the project_root folder so do not confuse them. Add all libraries you need inside dependencies closure. Do not confuse dependencies closure with buildscript.dependencies. apply plugin: 'android' repositories { mavenCentral() } dependencies { compile files('libs/android-support-v4.jar') //here is depenency from Maven Central Repository compile 'org.roboguice:roboguice:2.0' //here is dependency from your local libs folder compile

Categories : Android

Android Studio: add project as library
Edit the settings.gradle file (in directory f:/my project), it must contains something like this: include 'my app','my library' If this file don't exists: create it manually. The settings.gradle contains the list of gradle modules in a multi-module project. Then you must add the dependency to your library in app. To do so edit the my app/build.gradle and add this line : dependencies { compile project(':my library') } I also notice that you don't use default structure for your projects (i.e. you put the code in src/ instead of src/main/java) so you will have to overwrite some values of the default fileSet in the build.gradle of your projects. Be sure to have something like this in my app/build.gradle and my library/build.gradle : android { sourceSets { main {

Categories : Java

How to create Titanium Android Module with external library(jar)?
take a look at this links: 1) https://wiki.appcelerator.org/display/tis/Creating+a+New+Titanium+Module 2) http://docs.appcelerator.com/titanium/3.0/#!/guide/Android_Module_Development_Guide

Categories : Android

Android Studio failed to build App Engine module
Make sure you have fresh install of Android Studio 0.2.+. Upgrade from pre 0.2 doesn't work as google included extra maven repo to serve support libraries. Edit: path in the log is correct, just stackoverflow plays silly and hides before .

Categories : Android

How do I add a library project SherlockBar to the Android Studio?
Two options : You get the .jar and you add it into the Libs folder of your project. You add Sherlock as an Android Porject into Android Studio and in you project properties, you add it as a library.

Categories : Android

Importing library project in Android Studio
I solved upgrading to Android Studio 0.2.6. Here, the "New Module" issue has been fixed, so you can add a new library module to your project. Then, I replicated the library project into this new module (adding manually activities, files, resources...), and now I've a working gradle project. I know this is a bit tricky, but I had to make it work!

Categories : Android

android studio add library project error
Finally after days of trying i solved it ! In the previous referenced answer in step 8 : Now in Actionbarsherlock module delete android-support-library (because this is second copy of this library - it will cause build errors). Just i ignored this step and it works fine for me.

Categories : Android

import external library in android studio 0.2.8
Step 1: Select Project > Right Click > Open Module Settings (F12) > Projects Settings > Click Modules. Step 2: Click your Project > you will see 3 tabs : Sources/Path/Dependencies. Step 3 : Select Dependencies tab. You will see green '+' button to the right of 'Scope' title. Click on this and it will allow you to add Jars and libs. PS: make the scope of the added jars/libs as Compile

Categories : Android

The best way to integrate third party library in Android studio
Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder Right click it and hit 'Add as library' Ensure that compile files('libs/gson-2.2.4.jar') is in your build.gradle file Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean. I'm on Mac OS X, the command might be different on your system This series of steps was taken from Android Studio: Add jar as library? and is not my original answer. I am posting them here, again, because your question was the third in search results on Google when looking up this same topic. Hence, copying. All credits to the one who wrote the steps.

Categories : Android

Can't add custom Library Project with Android Studio
I believe the build.gradle file of the project you are trying to import do not specify the right paths because it can't find AndroidManifest.xml: Main Manifest missing from C:UsersckuAndroidStudioProjectsMyApplicationProjectMyLibrarysrcmainAndroidManifest.xml It is trying to locate AndroidManifest.xml inside the default folder structure which should be: -Project - src -instrumentText -main -java -res AndroidManifest.xml As you are importing a project I believe it has other folder structure, which you should inform in build.gradle like this: sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs =

Categories : Gradle

Android Studio Import Module Gradle Build Error
Do not add modules through the Studio interface. Always make the changes directly in build.gradle and then reimport into Studio. Also, update the plugin dependency to com.android.tools.build:gradle:0.4.+ to get the latest 0.4.* version.

Categories : Android

Blank menu, NullPointerException in Android Studio 0.2.5 when trying to create new module
I was able to add a new module by manually creating a new folder and copy/pasting: Another module IML file (renaming it after) build.gradle file from another module creating all the Android files manually (Manifest, RES files, SRC files) Then if you restart Android Studio, it should see it a new module. This is not the best solution but a workaround in the meantime.

Categories : Android

Android Studio, NavDrawer and support library issues
If your other dependencies also depend on the support lib, you need to make sure they are not using local dependencies (ie embedding the jar file). You should always use only dependencies { compile 'com.android.support:support-v4:x.y.z' } and not a local dependencies. Make sure all your dependencies do the same and Gradle will automatically detect that everything depends on the same library and only add it once to dex.

Categories : Android

How to import remote library in Android Studio using gradle?
You can use: compile 'com.nineoldandroids:library:2.4.0+' or if you have the library copied to your project libs directory, you can use: compile files ('libs/ nineoldandroids-2.4.0.jar') however, you can check out my post on getting started with swipelistview: http://modewagon.wordpress.com/2013/09/16/getting-started-with-swipelistview/

Categories : Android

Proper way to add global library in android-studio/gradle
With Android Studio, you have to first understand that the IDE uses the same model for a project that your command line build (gradle) uses. That is why the Project Structure dialog has a pop up that says edits here will have no effect. So adding a global library will also have no effect. The correct way to fix such issues is to edit your gradle build scripts so that the command line gradle build works properly. Then you should just have to click on "Tools | Android | Sync Project with Gradle files" menu item to refresh the project structure in the IDE. Finally, if your dependencies are not going to be in Maven Central, then you'd have to create a local maven repository. Read the thread here: https://groups.google.com/d/msg/adt-dev/eCvbCCZwZjs/vGfg-4vNy9MJ for background.

Categories : Android

Adding support library to android studio project
I fixed it.... All I needed to do was run ./gradlew clean build in the root of my project. Android studio wasn't updating the gradle so it didn't include the external libraries.

Categories : Java

Android Studio Failed to load platform rendering library
Have a look to this android studio rendering problems. It solved the problem for me changing from version L to 19.

Categories : Android

Library projects in Android Studio only work if nested in the project tree?
Every step are here : How do I add a library project to the Android Studio? If you want to more about gradle see the Google I/O conference by Xavier Ducrohet on youtube : http://www.youtube.com/watch?v=LCJAgPkpmR0

Categories : Android

How to import Actionbar sherlock library in new latest version of android studio
If your ActionBarSherlock library doesn't contain a build.gradle file, grab it from here: https://github.com/JakeWharton/ActionBarSherlock/blob/dev/actionbarsherlock/build.gradle. Save this file into the root directory of the library. If you're referencing the library from outside of your project directory, you should define where the library is in settings.gradle, like so... project(':actionbarsherlock').projectDir = new File('/path/to/library') and then right before that line, you should have: include ':actionbarsherlock' Now, in your build.gradle file, include the following... dependencies { compile project(':actionbarsherlock') } Now you should be able to build with Gradle. If you're unfamiliar with Gradle, start reading about it here: http://www.gradle.org/docs/current/use

Categories : Android

Android Studio gradle error after importing additional library - smack
Just had this problem, I needed to add my custom jar library to the build.gradle file: dependencies { compile files('libs/android-support-v4.jar') ADD FILE HERE }

Categories : Java

Is there a way to convert an Eclipse, 1 library + 2 application projects into an Android Studio, 2 build variants
You should use Eclipse Export tool to generate gradle files for you. then you can easily export it in Android Studio

Categories : Android

Android Studio importing library Gradle: error: package org.simpleframework.xml does not exist
You could also use Maven to declare that dependency in your build.gradle, like this: dependencies { [...] compile 'org.simpleframework:simple-xml:2.7' } also make sure that you have maven central declared as a repository: repositories { [...] mavenCentral() } Another common solution if you want to download the .jars by yourself is to include any .jar inside libs/, like that: dependencies { compile fileTree(dir: 'libs', include: '*.jar') [...] } Anyway, make sure that you don't include a library more than once, that could cause problems.

Categories : Gradle



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.