Stream

Join this community to post or comment

KwangJo Lee

Android Studio  - 
 
Is there a way to run specific test class using connectedAndroidTest?

follow commend does not work for me. 
I am using latest gradle 2.4.
gradle connectedAndroidTest --tests "*.mytestcase" 
1
Add a comment...

Yongce Tu

Gradle Build System  - 
 
I want to write some test cases for customized lint rules. When I tried "lint-tests", I failed to download the corresponding files. 

build.gradle:

dependencies {
    compile 'com.android.tools.lint:lint-api:24.3.0-beta4'
    compile 'com.android.tools.lint:lint-checks:24.3.0-beta4'
    testCompile 'com.android.tools.lint:lint-tests:24.3.0-beta4'
}

compile error:
$ ./gradlew :archLintRules:test
:archLintRules:compileJava UP-TO-DATE
:archLintRules:processResources UP-TO-DATE
:archLintRules:classes UP-TO-DATE
:archLintRules:compileTestJava

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all dependencies for configuration ':archLintRules:testCompile'.
> Could not find com.android.tools.lint:lint-tests:24.3.0-beta4.
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/tools/lint/lint-tests/24.3.0-beta4/lint-tests-24.3.0-beta4.pom       https://jcenter.bintray.com/com/android/tools/lint/lint-tests/24.3.0-beta4/lint-tests-24.3.0-beta4.jar   Required by:
      AndroidArch:archLintRules:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1
Add a comment...

Dian Wibowo

Android Studio  - 
 
Hello Everyone. I recently install Android studio on my computer, and i need to make another installation on another PC, the problem is it takes so long to download sdk files. so i copied sdk files from my computer to another PC's. but when i open the sdk manager the files still listed as not installed. does somebody here know how to make it goes? thanks before.
1
boris assoi's profile photoDian Wibowo's profile photo
5 comments
 
hello everyone, thanks for your suggestions. i did copy the files to the path so maybe i'm going to follow +Deepanshu Gupta 's instructions. i'll try it later because my another PC's cannot be used right now. i'll confirm it later. thanks.
Add a comment...

Alex Corll

Discussion  - 
 
The Graphical Layout Editor should issue a warning to inform users that the feature is extremely unstable and may cause Android Studio to become unresponsive resulting in loss of work. Thoughts?
1
Alex Corll's profile photo
 
3 consecutive days with crashes + lost work. You think I would learn. It works fine initially, performance degrades over time....until it eventually blows up. Tor n team, you guys do a great job! This issue has been around forever, when will it get prioritized? Can I help? haha
Add a comment...

AVISHEK BANERJEE

Android Studio  - 
 
While  importing project in android studio i am having an error of xml file invalid   and content is not allowed in prolog.. pls some1 help me out with this error
1
Diego D's profile photo
Diego D
 
Ask yourself : if people came to you with that little information, would you even be able to understand their question ? If the answer is no, you should probably rephrase ...
Add a comment...

Praveen Bhagat

Android Studio  - 
 
Pls help me i not able to create AVD. this screen appears at the end but not AVD is created.
1
David Herman's profile photo
 
Red flag: You're using Android Studio 1.0.1 and a lot of work has been done between that and Android Studio 1.2. Upgrading / installing latest should fix you.

Next: I wonder if you have a missing / incomplete SDK install... Can you navigate to your Android SDK and check that you have <SDK>/tools/emulator.exe? If so, go to File -> Project Structure and make sure to set your SDK location. If emulator.exe is missing, download the latest SDK from here: https://developer.android.com/sdk/index.html#Other
Add a comment...

Zayd Shaikh

Android Studio  - 
 
Hi everyone,

I was wondering if there is any way to get Android Studio to render fonts in the layout preview window?

Thanks
1
Pablo Costa Tirado (Sotti)'s profile photoDeepanshu Gupta's profile photo
3 comments
 
In recent versions of the SDK (not sure if API 22 or M Preview) you can also see custom fonts in the preview editor. (see this answer from above stack overflow post posted by Pablo: http://stackoverflow.com/a/19692166/1546000)
Add a comment...
 
Is it possible to emulate on Nexus 9 screen resolution of phone with lower dpi?! I want to run app in 480x320 resolution on Nexus 9 screen.
2
Add a comment...

Martin Vandzura

Gradle Build System  - 
 
Hi folks, is it possible to change NDK_TOOLCHAIN_VERSION in gradle? Thanks.
1
Add a comment...

Chinna harsha

Android Studio  - 
 
How to align the paragraph in "Justify format" in android studio
1
Add a comment...

Natarajan Raman

Discussion  - 
 
Dear Friends, can you please let me know the tool you use to show your app on Android phone in Windows PC? I did some search heard about Mobizon and Droid etc.. But would like to know which one is the best... Criteria - I need this for a demo one time, so looking for a free tool. Thanks in advance. And posting here as I believe screen cast should help developer explain the app. Sorry if it is a wrong forum. Regards 
1
Natarajan Raman's profile photoCameron Naumann's profile photo
11 comments
 
Android Studio Has One Built In But it dont sync, or connect correctly
Add a comment...

About this community

This is the official community for the developer tools of the Android SDK: Android Studio, The ADT Eclipse plugin, as well as the emulator and command line tools. This is all about the tools to build great Android apps. Please do not post about libraries, about how develop an app or advertise your app. This will be heavily moderated and off topic messages will be removed. Also, be nice to each other!

Fooyou Liao

Android Studio  - 
 
I want a plugin like the Eclipse , the code assist   can auto fill the parameter ,  I mean that  not only code suggest, but also fill the method argument 
1
Fooyou Liao's profile photoDavid Herman's profile photo
15 comments
 
There's ctrl+p (cmd+p on mac) which shows the parameters in a popup, is that what you're looking for?
Add a comment...

RAHUL PAWAR

Android Studio  - 
 
there is problem with my Android Studio...the view are not being rendred from xml file..i cant see the graphical view of my xml...tried building....pls suggest solution
1
RAHUL PAWAR's profile photoAzahar Sheikh's profile photo
3 comments
 
Change your libarary api 19
Add a comment...

Mark Carter

Android Studio  - 
 
Does anyone else find it annoying/strange that (on OS X) Command Up/Down does not scroll to top/bottom like in most other editors?

I've since edited the Keymap, but shouldn't this be the default?
1
Add a comment...
 
I apologize if this is already posted. I found this helpful.

I was tired of using USB cable to debug apps. I searched on google and found a way to debug apps without USB.

Screenshot itself is pretty explanatory.

P.S. To find your device IP address, head to
1. Settings > About > Status > IP address
OR
2. WiFi > Advanced > IP address

UPDATE:
you might need to enable "ADB over network" option from Developer options if any.
1
Oleksandr Kucherenko's profile photoAbhishek Salokhe's profile photo
2 comments
 
+Oleksandr Kucherenko yes I got that point in other community. I'm not aware of networking thing so masked it.
Add a comment...

Akhil

Android Studio  - 
 
Im new to android studio. and i need a help.
i have downloaded android bundle and now its downloading extra components.
as my internet connection is too low here(40-50Kbps)., i need to know is there a way how i can get these additional components as a file. so that if i want to install it on another PC, i wont require internet connection to start android studio.

PLEASE HELP ME....
1
Akhil's profile photoVishnu Mangalasseri's profile photo
3 comments
 
Yeah
Add a comment...

Armenak Petrosyan

Android Studio  - 
 
Error:Gradle: Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\ArmenPetrosyan\AppData\Local\Android\sdk\build-tools\23.0.0-preview\aapt.exe'' finished with non-zero exit value 1


==========&======
Error:(13, 23) Gradle: No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher').


help
1
Armenak Petrosyan's profile photoNils Walkowiak's profile photo
4 comments
 
Have you defined the "android" namespace? See here http://developer.android.com/guide/topics/manifest/manifest-element.html at the beginning
Add a comment...

Bruno Santos

Gradle Build System  - 
 
How can I set a different test and compile output directories for the Android gradle plugin?

I have a gradle task plugin that needs to do some class instrumentation on the compiled test classes and provide its output directory to the android test execution task.

Basically:

my plugin task input directory = android test compile task output directory
android test input directory = my plugin task output directory
2
Add a comment...

Oleksandr Kucherenko

Gradle Build System  - 
 
Android Test + Espresso + JaCoCo
If you try to run Espresso tests on device and at the same time grab the code coverage information, than your are looking on the right topic... Its all about this.

Unfortunately JaCoCo + Espresso does not work for everyone. 

Quick search will reveal a planty of reported issues and mostly no working solutions. I also ignore this problem till Michenux contact me and ask for help. (Good for us all in Sweden is a "red date" in calendar and I have some free time)

The issue and why it exists?
AndroidTest configuration produce a special APK. Inside it included source code of the original binary, libraries and instrumentation. Problem is that Android Dalvik is not 100% compatible JVM, so it does not support JVM javaagents (its the way how originally JaCoCo/Emma should be used with Java). So everything we need is inside the APK, but we cannot able to run it properly.           

That is why inside Android should be used a special way for code coverage instruments. Its known as a "JaCoCo offline mode". In two words - this is a pre-processing of *.class files and embedding into them of special Jacoco method, that executed from class constructor. So when you execute the tests, Jacoco is able to identify that and collect runtime information.

Example: https://raw.githubusercontent.com/OleksandrKucherenko/EspressoTestCoverageApp/master/jacoco-offline.png

Android build system should do that all, but looks like it fails at the current moment. 

Steps that build system should do:
1) download and install dependency JaCoCo library - DONE
2) include JaCoCo Agent into APK - DONE
3) create classes with enabled jacoco (offline mode) - DONE
4) replace original files by "jacoco enabled" - NOT WORKING
5) define coverage result output path - NOT WORKING
6) run tests - DONE
7) PULL coverage file from device - NO
8) Generate HTML coverage report - NO

The Solution
all in this Gradle file: https://github.com/OleksandrKucherenko/EspressoTestCoverageApp/blob/jacoco/app/build.gradle

Step #1: use the latest version of JaCoCo ("0.7.5.201505241946")
Step #2: Destination path can be defined by resource file - jacoco-agent.properties (~/src/androidTest/resources/jacoco-agent.properties). [for alternative look inside the org.michenux.espressotestcoverageapp.AndroidJacocoTestRunner class]

> #destfile =/sdcard/coverage.ec
> destfile=/data/data/{package.name}/coverage.ec

Step #3: Modify build sequence. Place own customization tasks between "preDex${flavor}${buildType}AndroidTest" and "dex${flavor}${buildType}AndroidTest". I name them: "fixJacocoAgentAndroidTest${flavor}${buildType}" and "fixJacocoAndroidTest${flavor}${buildType}"

Step #3.1:
"fixJacocoAgentAndroidTest${flavor}${buildType}"  - this task include jacocoagent.jar into final binary (simply copy JAR into "${project.buildDir}/intermediates/pre-dexed/androidTest/${flavor}/${buildType}" folder). After that other tasks will use it during the compilation. 

Step #3.2:
"fixJacocoAndroidTest${flavor}${buildType}" - copy "jacoco enabled" classes on top of old classes.

Step #4:
Run the project. Inside the app folder you will find a "coverage.ec" with non-zero size. 

Project: https://github.com/OleksandrKucherenko/EspressoTestCoverageApp

What's left:
- PULL file from device to PC (adb pull *)
- create JaCoCo HTML report (I did this in my older posts, just use the gradle from them, it will work if you pull coverage file into project build folder)

P.S. latest android gradle plugin (1.3-beta3) looks like partly resolves the issues
15
15
Tobias Preuss's profile photoFrancesco Noya's profile photoAndroid Resources's profile photoIonut Negru's profile photo
8 comments
 
Oleksandr, thanks for your reply - I'm trying this now. The answer to your question - we didn't manage to run the tests using the app source so decided to go with app.apk, and still want to have the coverage for these tests
Add a comment...