android-studio

Android multi module test dependency

这一生的挚爱 提交于 2020-03-18 03:28:06
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

Android multi module test dependency

为君一笑 提交于 2020-03-18 03:28:02
问题 With Android Studio 3.0 / android_gradle_version = '3.0.1' / gradle-4.5 Let's say I have two android modules module-base module-a When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle dependencies { implementation project(path: ':module-base') } But, what if I want to access test sources from module-base in test of module-a ? Here does not work approach like above dependencies { testImplementation project(path: ':module-base') } I found

ApkProvisionException after upgrading to android studio 3.6

霸气de小男生 提交于 2020-03-17 09:48:29
问题 Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: No outputs for the main artifact of variant: debug There is an application id in my build.gradle file too, but still I am getting this error. Is there any way to get rid of this. 回答1: I have the same issue with the latest version of Android Studio (3.6). I checked and apk is indeed created in app/build/outputs/apk/ folder of my project and I guess for now you can just drag'n'drop apk from folder to emulator.

Download and install Android studio gradle offline

纵然是瞬间 提交于 2020-03-17 09:26:59
问题 I have been having internet issues, so installing gradle for android studio has been a big issue, so I downloaded the zip file. However, I dont know how to install it offline and set Android studio to use the offline version. I need help. 回答1: 1st open below link and download the latest complete version of Gradle https://gradle.org/releases/ Now you find your path where your android studio install then Find .gradle folder, normally gradle is present here... C:\Users\**YourAccountFolder**\

Android Studio - view both Text and Design preview of layout

前提是你 提交于 2020-03-17 07:41:13
问题 In Android Studio, how can I view both the text and design preview of an XML layout side by side. I could see it by default when I installed Studio, but now that is gone, and I'm not sure why. I can only see or the other. How do I re-enable it? 回答1: Open your [whatever].xml . At the bottom you'll see Design and Text . Select Text . If you still can't see the actual layout, only xml, then select " Preview " which is located at the right of the window, between Gradle and Maven Projects . Hope

Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet]

陌路散爱 提交于 2020-03-17 06:41:26
问题 I'm receiving this error when I run my application. The error: Caused by: java.lang.NoSuchMethodException: <init> [class android.content.Context, interface android.util.AttributeSet] at java.lang.Class.getConstructorOrMethod(Class.java:472) at java.lang.Class.getConstructor(Class.java:446) at android.view.LayoutInflater.createView(LayoutInflater.java:574) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)

Re-enable “component tree” in Android Studio

我是研究僧i 提交于 2020-03-17 04:17:11
问题 After updating to the last version (1.4 Beta 2) in Android Studio, the "component view" in the layout editor disappeared. How can I enable this tool again? 回答1: If you are looking for the component tree, go on the bottom left of Android Studio then click on the square (the one who show/hide the tool on the left, bottom and right) then on Designer. A new tab should be on the right part of android studio, with gradle and maver project. 回答2: I lost mine too, and then realized that they just

Failing to open file, am I linking it wrong? Or is Android Studio not seeing it for some reason?

拜拜、爱过 提交于 2020-03-16 10:09:53
问题 I have a simple .txt file with just a couple lines in right now, each line has a word then a comma then another word, representing a very simplistic username , password bank. For some reason though I cant get the File to open to read from it. Here is my code that I'm using.... try { final String PATH = "src\\main\\assets\\passwords.txt"; Log.w("myApp", "passed"); List<String> user_password = FileUtils.readLines(new File(PATH)); Log.w("myApp", "passed2"); @SuppressWarnings("unchecked") List

Failing to open file, am I linking it wrong? Or is Android Studio not seeing it for some reason?

时光怂恿深爱的人放手 提交于 2020-03-16 10:09:34
问题 I have a simple .txt file with just a couple lines in right now, each line has a word then a comma then another word, representing a very simplistic username , password bank. For some reason though I cant get the File to open to read from it. Here is my code that I'm using.... try { final String PATH = "src\\main\\assets\\passwords.txt"; Log.w("myApp", "passed"); List<String> user_password = FileUtils.readLines(new File(PATH)); Log.w("myApp", "passed2"); @SuppressWarnings("unchecked") List

Failing to open file, am I linking it wrong? Or is Android Studio not seeing it for some reason?

会有一股神秘感。 提交于 2020-03-16 10:08:51
问题 I have a simple .txt file with just a couple lines in right now, each line has a word then a comma then another word, representing a very simplistic username , password bank. For some reason though I cant get the File to open to read from it. Here is my code that I'm using.... try { final String PATH = "src\\main\\assets\\passwords.txt"; Log.w("myApp", "passed"); List<String> user_password = FileUtils.readLines(new File(PATH)); Log.w("myApp", "passed2"); @SuppressWarnings("unchecked") List