w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Add commons-io dependency to gradle project in Android Studio
you need to declare a repository where you want to resolve the commons-io library from (e.g. MavenCentral): buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories{ mavenCentral() } dependencies { compile files('libs/android-support-v4.jar') compile group: 'commons-io', name: 'commons-io', version: '2.0.1' }

Categories : Gradle

How to access a js file from another js file in titanium studio android project
You have to use Alloy to do this, to open the Home controller view just do this: function login_Click(e){ var homeController = Alloy.createController('home'); // If home.xml's container is a Window this will work homeController.getView().open(); }

Categories : Android

no gradle file in eclipse project Android studio
All you need is a simple build.gradle file for your ActionBarSherlock project. Here's one I've created: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } apply plugin: 'android-library' dependencies { compile 'com.android.support:support-v4:13.0.0' } android { buildToolsVersion "17.0" compileSdkVersion 17 sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } } }

Categories : Eclipse

Failed to import Gradle project error creating new project with Android Studio
I had same issue with the latest Android Studio () today, and I finally found that configuring a https proxy for Gradle can solve the issue. I only set a http proxy at the beginning. Gradle needs to sync some files via HTTPS. Use IP address instead if hostname of proxy can't work.

Categories : Android

Add an Android Studio / IntelliJ project to a code.google.com project with git
OK, so the best solution I've come up with is to create a local git repository, create a code.google.com git project, and then manually connect the local repository to the code.google.com project. Note that this requires git to be installed on your development machine. Create the app project in Android Studio. Select the root project folder. Select VCS > Import into Version Control > Create Git Repository Select project folder to create a git repository. Now the project is under source control. Create a project at code.google.com using git source control. Go to the Source > Checkout page of the project and get the clone URL. Open a terminal and navigate to the project directory. Modify the local git repository to connect the remote repository on code.google.com: git remote add origin ht

Categories : Android

how to process android ndk project dependency
I've found an alike thread that describes the same question. And I've solved the problem with the solution in the thread. How to use a library project with both c and java apis on Android

Categories : Android

Android Studio: Importing project into existing project
Try going to File -> "Import Module" instead of "Import Project". In Android Studio, an entire window is a project. Each top-level item in that project is called a module. Coming from the Eclipse world, it'd be: Eclipse workspace = Android Studio project Eclipse project = Android Studio module

Categories : Android

Change project file structure after migrating from Eclipse to Android Studio gradle structure
While migrating your project from Eclipse to Android Studio, no change have been done on project structure. The only that have changed are new .iml and .gradle files. Your java code stays in project/src/ folder, and has not been moved in project/src/main/java folder (like in a new created project from AndroidStudio). Your AndroidManifest file also stays in the project/ folder and has not been moved in project/src/main/ folder (like in a new created project from AndroidStudio). At migration, the build.gradle file is customized in order to be able to compile with the old structure is described in the gradle documentation : Configuring the Structure For a new created project in AndroidStudio, the sourceSets part of the build.gradle file : sourceSets { main.java.srcDirs = ['src/java']

Categories : Android

Could not find class 'com.thoughtworks.xstream.XStream'
This project is done by somebody and given to me for further implementation. So, After so much headache, i find that the project contains Android Private Library which includes XStream jar file. You can see below image i fix this issue by check the Android Private Library in Order and Export. This link helped me to solve this issue. Hope it saves somebody time ....

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

Automatically versioning Android project from git describe with Android Studio/Gradle
After some further reading and several false starts, I ended up with this, added to the bottom of build.gradle in the project directory (that is, MyAppProject/MyApp/build.gradle, not MyAppProject/build.gradle -- confusing, I know, but the former directory is projectDir in Gradle so that's how I refer to it here). It depends on no external utilities other than Git, which is assumed to be in the path, so it should work on any OS (even though I used forward slashes in the paths, they get converted to backslashes on Windows). It could probably stand to be improved, I'm sure, as my understanding of Gradle is pretty rudimentary and my Groovy may not be very idiomatic (though that in particular is less of a concern). I have a feeling that my approach is suboptimal because it involves generatin

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: How can I open an older android project in Android Studio?
Look at this links. How do I open my existing Eclipse projects in Android Studio? http://developer.android.com/sdk/installing/migrate.html

Categories : Android

How do I migrate my Android Eclipse project to using Gradle and Android Studio?
You should create a folder in you project's root and name it libs. Then copy your jar file to that folder and add dependencies { compile fileTree(dir: 'libs', include: '*.jar') } to your build.gradle file. If above won't work. You may need to try this post

Categories : Java

How to create the best Android app project structure with Android Studio and Gradle?
You should look at the multiproject example for the layout attached in the doc. http://tools.android.com/tech-docs/new-build-system http://docs.google.com/viewer?a=v&pid=sites&srcid=YW5kcm9pZC5jb218dG9vbHN8Z3g6NDYzNTVjMjNmM2YwMjhhNA Essentially you want a top level settings.gradle that tie all the pieces together. Ideally they should be in one single git repo to make your life easier. However you probably can use symlink to tie them into a common build repo that contain your top level settings.gradle.

Categories : Android

Import an Android Project from Eclipse to Android Studio and I have this error message "failed to find Build Tools revision 8.0.0"
Your build.gradle is trying to use Android SDK tools 8 which isn't installed on your machine. If you look at your build.gradle file you probably have this line buildToolsVersion "8". You want your build.gradle file to point to the Android SDK tools that you currently have installed (preferably the latest). Just open the Android SDK manager and see which tools you have installed and change the buildToolsVersion "8" to the right version.

Categories : Android

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

Android copy existing project with new name in Android Studio
The steps in the link you specified should also work for Android Studio. Just make a copy (using a file manager) of the entire module folder and give it a new name. Now open it up and use Refactor -> Rename (right click on the item you want to rename) to rename your module and package. See this for details about refactoring in IntelliJ/Android Studio.

Categories : Android

Android Studio need to rebuild project before each run
It's a known issue. Maybe you should try this: Same issue here, to avoid rebuild EACH TIME, i'm going to my module project settings -> Dependencies and up or down one of my library item -> Apply -> Ok -> Make regenerating R.java. You could also try unchecking "Use external build" in compiler settings: File -> Settings (Ctrl+Alt+S) -> Compiler -> Uncheck "Use external build"

Categories : Android

Collaborating on Android Studio Project using git
You would need to check if: you can configure Android Studio to use relative paths in the .iml (as shown in this old issue, using file://$PROJECT_DIR$/..., or this issue using content url="file://$MODULE_DIR$/...) or you would need to register a content filter driver (in a .gitattributes file) able to replace, on checkout, any absolute path by $MODULE_DIR$. If that 'smudge' script doesn't detect any, your module.iml will be unchanged. If it does detect absolute path, that script can introduce the proper modifications, and you will add and commit those, for others to reuse your project in a more portable way.

Categories : GIT

Change project name on Android Studio
Right-click on your root project directory Select Refactor -> Rename Select rename project and change the name there. Also Select rename module and change it there as well. If you get an message saying module name already changed thats fine. Now right-click on the project root folder again and select Open Module Settings. Under the Modules section remove whatever folders are associated to your old project name. Apply Settings and hit OK. Restart Android Studio. Hope that helps!

Categories : Android

How to use a Android Studio project on two computers?
Like the others i agree, that using a VCS would be the best solution. Even though you can try to filter all android studio related files (like *.iml, .idea folder and local.properties). I don't know if you can do this with dropbox or if you need some kind of 3rd software. After that you should be able to make source code changes on both computers without greater problems. (You may have to declare project dependencies changes for the android studio twice) Builds depending on the build.gradle files should work to. But again: using a VCS is the better way to go.

Categories : Android

Android Studio cannot create a new project
Extending on what @hoss said, updating any version prior to ver 0.2.0 requires a full un-unstallation, then re-install the new version found at the android developer website. Read specificly updating to 0.2.x You will find that many errors will be caused if these directions are not followed. This is because of a change in the build Gradle.

Categories : Java

Add JS and CSS support to Android Studio project
JS/CSS are not part of Android Studio. You'd have to install IntelliJ Ultimate edition if you need those. In general, you won't get a feature like that which is only available in a paid version in a free tool like Android Studio or IntelliJ Community Edition.

Categories : Android

Possible to clone TFS project with Android Studio
The problem was I didn't have my secondary credentials setup. From the visualstudio website: Note: To clone and use this repository from Git tools outside Visual Studio, you need to ensure alternate credentials are enabled in the Profile dialog. Once I added that I was able to clone the repo without a problem.

Categories : GIT

Android Studio The project is already registered
I had a similar problem with ABS and other library imports. The 'Project Structure' interface just wouldn't show the modules. On trying to import the modules, it would prompt, "The project is already registered". Seems to be an IntelliJ/Android Studio issue. Invalidate Caches option didn't help. Reimporting the project after some cleanup did work for me. As a precaution, take a backup of your project and store it safely Ensure that your project builds via gradle command-line and you have all required dependencies specified in respective build.gradle files. Try building with: gradle clean && gradle build Close the project in Android Studio (or close Android Studio) Delete .iml files and .idea folders from all modules and the main project Start Android Studio and reimport the proj

Categories : Android

Import project into Android-Studio
Managed to solve on my own. Needed to alter the build.gradle file a bit so the buildscript->dependencies will hold this: classpath 'com.android.tools.build:gradle:0.5.+' and not: classpath 'com.android.tools.build:gradle:0.4' Then used the "local gradle distribution" option with the 1.6 version I downloaded and it worked fine.

Categories : Intellij Idea

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

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 do I export an Android Studio project?
In the Android Studio go to File then Close Project. Then take the folder (in the workspace folder) of the project and copy it to a flash memory or whatever. Then when you get comfortable at home, copy this folder in the workspace folder you've already created, open the Android Studio and go to File then Open and import this project into your workspace. The problem you have with this is that you're searching for the wrong term here, because in Android, exporting a project means compiling it to .apk file (not exporting the project). Import/Export is used for the .apk management, what you need is Open/Close project, the other thing is just copy/paste.

Categories : Android

Add Holoeverywhere to project in Android Studio
To get it working on the most basic of levels just follow the advice given here: https://github.com/Prototik/HoloEverywhere/wiki/Import-in-IDE Basically close all projects so you get to the welcome screen. Then: -> Checkout from Version Control - Git -> Type in Repository URL: https://github.com/Prototik/HoloEverywhere.git -> Press 'Clone', wait until repository checkout -> click 'Yes' on the proposal to open a project. This should give you a HoloEverywhere project thats ready to work with. Open up File > Project structure and check for any errors with missing libraries (for example I had to download manually the v4 r18 file). Click apply > ok to make sure changes are saved and return to the project. Click on demo and then click Run > Edit configurations. Click + then Android Applica

Categories : Android

Remove Project from Android Studio
File > Close Project move your mouse cursor on the project and press Delete keyboard button :) EDIT try this solution, works for me

Categories : Android

How to import Android Studio project in Eclipse?
As the others say, a full import is not possible, but just try a manual 'import'. The key files for an Android project are the Java sourcecode (src directory), the resource XML files and the Manifest. Just create a new Android project in Eclipse and simply copy these files over. You may have to create a new package structure, so construct the necessary packages and copy each sourcefile over and refactor the package name if necessary. If you use any additional libraries, you may have to manually import them as well.

Categories : Android

Android Studio doesn't create new project
When you are creating a new project, you have to select "Android Application Project" (File --> New--> Android Application Project) instead of directly creating Android Activity. Once you have created a new "Android Application Project", you will find all the required files & then you can go on creating "Blank Activities" (File --> New --> Others--> Android --> Android Activity --> Blank Activity).

Categories : Android

Android Studio adding external JAR to the project
the error message format shows that you are not using Gradle to build. You either loaded the eclipse project file (.classpath/.project) or had some existing iml files. This means changes to build.gradle will have no effect since Studio uses the IntelliJ internal builders instead. You need to import your build.gradle file instead to create a new Studio project.

Categories : Gradle

What files should I add to SVN ignore in an Project using Android Studio
I added the following items in my .gitignore, it should be the same for SVN: gradle .idea *.iml build .DS_Store (for mac only)

Categories : Android

Android Studio: Default project directory
At some point I too tried to do this, but the Android Studio doesn’t work quite like Eclipse does. It's simpler: if you create a project at, say /home/USER/Projects/AndroidStudio/MyApplication from there on all new projects will default to /home/USER/Projects/AndroidStudio. You can also edit ~/.AndroidStudioPreview/config/options/ide.general.xml (in linux) and change the line that reads <option name="lastProjectLocation" value="$USER_HOME$/AndroidStudioProjects" /> to <option name="lastProjectLocation" value="$USER_HOME$/Projects/AndroidStudio" />, but be aware that as soon as you create a project anywhere else this will change to that place and all new projects will default to it. Hope this helps, but the truth is there really isn't much more to it other than what I expla

Categories : Android

Adding Samsung SDK to Android Studio project
Maybe you can follow the instructions in chapter 8 in this document. Click here (invalid link) Be also sure of the .classpath file is not hidden in your project folder, when adding your .jar file. It can typically be the issue.

Categories : Android

Cant create android studio project after updating to 0.2.1
This is most likely a problem with your Android SDK. New updates to the Android SDK / Android Studio sometimes add extra required repos for SDK libraries. By looking at your error message, it appears that you are missing the Android Support Repository: When updating your Android SDK, also be sure that your are updating the correct SDK location. Android Studio now ships with its own SDK copy already integrated. If you are building from the commandline and also using Android Studio, you may have two copies of the SDK (one which is accessed via commandline and one which is accessed when building from Android Studio. Updating one of these will not automatically update the other.

Categories : Ubuntu

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



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