w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to open android documentation and samples of code in android studio
First you need to make sure the documentation is added to Android Studio. Go to File -> Project Structure. Under the Platform Settings heading, add or select an Android Platform. Go to the Documentation Paths tab and make sure the path to your SDK's documenation folder is added there - it should be [SDK]docs eference, where [SDK] is the full path to your SDK installation. If it is not there add it manually. Once this is done, use Ctrl+F1 while your cursor is on the item you want to display help for. The samples have not been ported to Android Studio yet, but I'm sure google will get around to it at some point. For now follow the instructions in the comments by androidika (you will need a copy of Eclipse installed).

Categories : Android

Cannot Open Layout Files in Android-Studio
In my situation, I had placed a new folder in my res folder with original non-resized images of my icons and resources in case I want to edit them later. This broke Android Studio in several places. As soon as I moved that folder elsewhere, everything returned to normal.

Categories : Android

Android Studio build error - Multiple dex files define Landroid/support/v4/
For anyone who is interested, I solved my own problem. My mistake was that I had pasted android-support-v4.jar and google-play-services.jar in all of my project's module lib folders (my project consists of 3 modules). What I had to do instead was to paste these jars only into my main module's lib folder, and the other modules would automatically reference them.

Categories : Android

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

Wrong build being deployed on Android device using Visual Studio 2012 Xamarin.Android
I have no idea why it does this, I had this issue before. I also noticed that the device log was somewhat behind (ie, at 3.30pm, the last record on the device log was 11.00am). Uninstalling the app from the device and re-deploying it seems to correct it. Note: I had this issue in VS, didn't check with XS. I would look at the difference in your deployment settings in VS and XS (I think it may have something to do with the Fast Deployment option).

Categories : Visual Studio 2012

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

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 AddThis sdk + Facebook sdk won't build in Android Studio
I was able to resolve this issue: Since the Facebook SDK is a module and not a jar, I referenced AddThis0.8.8.jar from the Facebook SDK module, and removed the reference to it from my project directly. After doing so, there was still a conflict between com.facebook.android.* in the Facebook SDK and the duplicate ( com.facebook.android.* ) in the AddThis jar. So, I deleted the com.facebook.android package along with it's contents - from the Facebook SDK - then included com.addthis in ( class path, I think? Android Studio suggested to include it when I typed "ATButton" in code. I said "Heck yea, thanks JetBrains!" ). I am now able to use AddThis as well as the Facebook SDK without any conflicts. I hope this process can help someone out there in some way. [Edit] There were still problem

Categories : Android

What Product Flavor does Android Studio build by default in build.gradle?
On the lower left of the Studio window there's a docked view called "Build Variants". Open it and choose whichever variant you want to work on. This will impact which variant is built but also the enabled source folders, which will drive completion in code and resources editors.

Categories : Android

Error: Gradle: Execution failed "Running /Applications/Android Studio.app/sdk/build-tools/android-4.2.2/aapt failed"
This is because one or more of your asset names have unsupported characters present. Replace all capitals with lowercase letters. Replace all spaces and dashes with an under-bar/underscore. AND to be safe, remove all numbers too. Another suggestion I've seen going around is to make sure your SDK is up to date, but from my own experience it has always been the names of imported assets.

Categories : Gradle

Unable to build from Android Studio
I found out if I import module by "Create module from existing sources", this problem went away. I had selected "Import module from external model" with Gradle. This option generated the above message.

Categories : Android

Android Studio can't even build/run my app anymore
I resolved it by these steps: 1) firstly I tried to delete all lines with <option name="ASSEMBLE_TASK_NAME" value="bundleDebug" /> from all my iml files and I got another error "Task 'assemble' not found in root project" 2) then I deleted Android asset from root project and error disapeared Seems like Android asset is a key

Categories : Android

Android studio build error
I faced the same failure and the problem was with my jdk/jre because some time ago I added the Bouncy Castle Crypto APIs functionality by adding the jar to my jdk/jre path. I tried a gradle build with a "clean" jdk/jre and problem was solved

Categories : Gradle

Android Studio fails to build
Check this instructions http://developer.android.com/sdk/installing/migrate.html Is oficial instrucction for Android.

Categories : Android

Android Studio Build/Clean
gradlew is not in your global path. To execute the 'clean' task (or any task for that matter) using the gradle wrapper (gradlew) in your project directory in your terminal, specify the current directory with the './': ./gradlew clean

Categories : Android

Android Studio/compiler not use external build
I try to import project back to eclipse and update eclipse and Android SDK Manager then in Eclipse, select File > Export.In the window that appears, open Android and select Generate Gradle build files.Select the project you want to export for Android Studio and click Finish. Then re import to Android Studio. I found an error about build tool revision 16.0.2 so I open build.gradle in text editor and change 16.0.2 to 17 and every thing goes very well. http://developer.android.com/sdk/installing/migrate.html

Categories : Android

Android Studio is not using gradle to build my projects
If you import an existing project with no gradle configuration, Android Studio will use the old build system. If you want to use gradle, you should follow the instructions in the documentation : http://developer.android.com/sdk/installing/migrate.html

Categories : Android

build errors with renderscript using Android studio 0.2.3; 4.3 SDK
Can you post the function signatures for the 3 functions causing issues? A large number of warnings and errors were added to catch minor mistakes. If this is an internal function not called from Java code, you probably just need to mark it static.

Categories : Android

Android Studio and Gradle - build fails
I found the problem: I removed that line from the sample gradle file. compile files('libs/android-support-v4.jar') However, I have no idea why this does not work (if I have 2 or 3 external libraries that all depend on the support library, how are we supposed to do, without touching their gradle files?

Categories : Android

Android studio Gradle build speed up
The dev are working on it. Like I posted in this answer the fastest solution right now is to use gradle from the command line and you should switch to binary libs for all modules you do not develop. On g+ there is a discussion with the developers about it.

Categories : Android

Android Studio Gradle Build Flavors
With this build script you are using build types AND flavors. For changing the xml file you only need the flavors. Try to delete buildTypes and use the productFlavor block as child of android. The changing of the res folder of the pro flavor should go into the sourceSets Block right after all the changes of the main sourceSet

Categories : Android

Android Studio doesnt build after update
I recently filed a bug report to Google. According to the thread in the Android developer tools forum this is an issue they can´t directly explain. I think this is as good as an answer we can get untill this bug is adressed by the developers.

Categories : Java

Android Studio 0.2.7 build exception with Gradle
Not being able to run the application may be because you didn't configure jdk/jre properly. Try making system variable PATH point to your ...Javajdk[version]in and CLASSPATH to ...Javajdk[version]lib. Also, in android studio go to file>other settings> default project structure > sdks and navigate to your jdk install folder.

Categories : Android

Android Studio / Gradle Build questions
yes yes hmm that's quite a lot. I think there are going to be issues. For instance right now Gradle doesn't let us parallelise the compilation of the variants, so it's going to take forever to build. Also, you might run out of RAM when setting up the internal model that represent all the variants and their associated properties and tasks. I guess you should just try it and see. Using simple groovy code you should be able to dynamically create 2000 flavors in an empty projects and then see if you can compile without problem.

Categories : Android

How to set up gradle and android studio to do release build?
in the latest version of android studio, you can just do: ./gradlew assembleRelease or aR for short. This will produce an unsigned release apk. Building a signed apk can be done similarly or you can use Build -> Generate Signed Apk in Android Studio. See the docs here Here is my build.gradle for reference: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' dependencies { compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['

Categories : Android

Build issues with Gradle Android studio 0.2.1
I finally managed to bring Android Studio back into working state. I gave up on the 0.2.1 update and reverted to 0.2.0, which we all know worked just fine. Here's how I did it: I uninstalled Android Studio ( Add/Remove Programs ), deleted the contents of Androidandroid-studio ( except for sdk folder and SDK Manger.exe ) and then downloaded and installed the more stable version from the bundle right here: http://developer.android.com/sdk/installing/studio.html#Updating After that, you should be able to reopen the projects you were working on, without encountering any other errors. Good luck!

Categories : Android

Android SDK manager cannot download samples of android
After investigation, "https://dl-ssl.google.com/ " is banned from accessing because of some reasons. And based on the solutions from network I can resolve the problem. The solution: environment: WINDOWS 7, Eclipse IDE with built-in ADT find the file hosts from the directory"C:WINDOWSsystem32driversetc" edit the file hosts, append "74.125.237.1 dl-ssl.google.com" save the file run the Android SDK manager.exe choose the uninstalled packages and download them

Categories : Android

Project imported from Eclipse to Android Studio. APK files and some other files in bin folder are not updating anymore
I don't know if there's a way to get a clean build via the UI (I haven't found it yet, anyway), but it's pretty easy via commandline. From the root directory of your project: ./gradlew clean

Categories : Android

How to write / build testing case in Android Studio 0.2.x
The problem is with your code. The constructor in your OrmLiteTest is written to take a Class. This may not be so. What you need is: public OrmLiteTest() { super(MainActivity.class); } Notice how the constructor doesn't have any parameters. An issue is that the constructor which Android Studio generates includes the Class parameter.

Categories : Android

Android studio add external project to build.gradle
Right click on project - Select "Open Module Settings" - Select "Modules" in left pane - Click on "+" symbol on top - Choose "Import Module". After importing Module. You need to add it as a dependency for your current project. Keep "Modules" Selected in left pane and click on your project - Now Go in dependencies tab and click on "+" symbol that is located at bottom - Choose third option "Module Dependencies" and if you have imported your project correctly, it will show you the all available module that can be added as a dependency to your current project. Hope it would help. Cheers!!

Categories : Android

Android Studio doesn't execute build.gradle
When being run in Android Studio, gradle's stdout where you can find your print statement is the "Gradle Console". Hover over the square in the bottom left of the Android Studio window and you'll see lots of options to select things like Console, Maven, Event Log, etc. Select Gradle Console and you should see the output that you get when running from the command line. If you still don't see your statement being logged, chances are something isn't configured correctly inside your Android Studio project. Try synching your project with the gradle build file by going the top menu bar and (on a mac) Tools > Android > Sync Project with Gradle Files. If there are no errors in this process you should be able to see the output in the Gradle Console.

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

Gradle build errors after updating Android Studio
Try adding a new file in the root of your project called "local.properties" (or modify the existing one). It should contain sdk.dir= followed by the path to the sdk location, in my case sdk.dir=/Applications/Android Studio.app/sdk I think Android Studio normally creates one automatically but says that it shouldn't be added to VCS. I put it in my .gitignore and cloned the project on my Mac which resulted in this error. Strangely before 0.1.5 it worked just fine without the file.

Categories : Android

Android Studio staying on Gradle build using tasks
The real problem is that previous version of Android Studio misconfigured the IDEA file (e.g. MyProject.iml). It added an extra <component name="FacetManager"> XML element that shouldn't be present. In the case above, the solution is to edit MyProject.iml and remove the <component name="FacetManager"> part as shown here: <module external.system.id="GRADLE" type="JAVA_MODULE" version="4"> <component name="FacetManager"> ...remove this element and everything inside such as <facet> elements... </component> <component name="NewModuleRootManager" inherit-compiler-output="true"> ...keep this part... </component> </module> See also Gradle: FAILURE: Could not determine which tasks to execute.

Categories : Android

How to use opencv in android studio using gradle build tool?
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url 'http://maven2.javacv.googlecode.com/git/' } } dependencies { compile 'com.android.support:support-v4:13.0.+' compile 'com.googlecode.javacv:javacv:0.5' instrumentTestCompile 'junit:junit:4.4' } android { compileSdkVersion 14 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 14 } } This is worked for me :)

Categories : Android

How do I manage changing SNAPSHOT depencies with Android Studio?
Another workaround is to delete the ~/.gradle/caches directory and then sync the project in Android Studio. This is not ideal since all your dependencies need to be re-downloaded, but its a little less intrusive that re-importing the project into AS as noted by @Joe. Terminal: rm -rf ~/.gradle/caches AS: Tools > Android > Sync Project with Gradle Files (or hit the "Sync Project with Gradle Files" menu button) EDIT Did some more researching and found this little gem. Just configure your dependency as such... compile ('groupId:artifactId:X.X.X-SNAPSHOT'){ changing=true } Then just run gradle clean assemble on the project that has the SNAPSHOT dependency. I did test to see if a newly added constant became available, and sure enough it worked.

Categories : Android

Android Studio - Unable to open PNG file
Are you using Windows? This error could happen if the generated build file path exceeds the Windows (not NTFS) max path length of 260 characters. Make sure your project path is not too long, use short names as well. More info from MS: Maximum Path Length Limitation In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here

Categories : Android

How to copy or use native libs with Android Studio Gradle build?
Due to security reason, it's not possible to reference a local jar/aar file in an application project with the gradle android plugin. For the support library, with the Android SDK Manager, you have to install the extra named Android Support Repository which will expose the support library inside a maven repository. Then you can add the support library in your project via : dependencies { compile 'com.android.support:support-v4:13.0.0' } For external libraries, you have 2 possibilities : Build an aar file and deploy it to your local maven repository, then reference it in your project like you did with the android support library. Put the library sources beside your application project and create a settings.gradle at root which will define the modules. (see the docs for more in

Categories : Android

Android-Studio upgraded from 0.1.9 to 0.2.0 causing gradle build errors now
Gradle should be updated already, you just need to let your previous projects know gradle has been updated. Source Edit your build.gradle file to show this: dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } This should only be required for projects created with the previous version of Android Studio. New projects you create will have that by default.

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



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