android-studio

the R.java file in android studio 3.4

北城余情 提交于 2020-08-05 09:41:20
问题 I'm just trying to learn android development, and am using the latest version of android studio, however, I cannot find the R.java file in my folder tree view: I've also cleaned and rebuilt my project but still, I can see neither the .../source/R folder nor the R.java file. 回答1: Try this: \app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\<package_name_tree>\R.java package_name_tree means : If package is a.b.c the goto: /a/b/c/R.java 回答2: i'm learning Android

Android Studio Duplicate Files

雨燕双飞 提交于 2020-08-05 07:03:16
问题 I am getting duplicate files in my source code: This happens quite often with Android Studio and it happens will all types of files, not just gradle files. It typically happens when I checkout a new branch or swith branches. What is causing this and how can I prevent it? As a note, this question was originally posted with image files, thus the image answers. However, this is not limited to image files and I understand why there are multiple image files for different screen densities. I have

Android Studio cannot be initialized (0xc0000005)

99封情书 提交于 2020-08-04 03:11:50
问题 I have just installed Android Studio in my new notebook running Windows 10 - 64 bits with Java SE 8 152, but it suddently it stopped working, like, every time I try to run the Android Studio, the error message below appears: "The application cannot be initialized correctly (0xc0000005)" I've already tried to reinstall, run as admin, deactivate the antivirus... nothing worked. 回答1: I had similar problem and disabling "Force randomization for images (Mandatory ASLR)" for studio64.exe in Windows

Android studio layout xml not updating

老子叫甜甜 提交于 2020-08-03 17:56:17
问题 I am using Android Studio latest version and recently facing a problem that, my layout xml Design view not getting updated rapidly if I have changed background from selector resource or changed the image resource background . I found that Rebuild Project again updating the layout. But my project is little big and its taking some time to rebuild again. It would be nice if there is any other quick solution for this. I have also tried the Synchronize xml option, but not worked as expected.

Android Studio setting node directory for build (Cause: error=2, No such file or directory)

一曲冷凌霜 提交于 2020-08-03 05:48:13
问题 My project build fails because it's using the incorrect directory to run Node. How do I go about setting the Node directory for these compile-time tasks? The specific task is: app:recordFilesBeforeBundleCommandDebug And the related error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'. Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'node'' Caused by: net.rubygrapefruit

Android Studio setting node directory for build (Cause: error=2, No such file or directory)

有些话、适合烂在心里 提交于 2020-08-03 05:47:47
问题 My project build fails because it's using the incorrect directory to run Node. How do I go about setting the Node directory for these compile-time tasks? The specific task is: app:recordFilesBeforeBundleCommandDebug And the related error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'. Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'node'' Caused by: net.rubygrapefruit

How to solve “Key was created with errors:”

喜你入骨 提交于 2020-08-02 07:08:05
问题 The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore -destkeystore -deststoretype pkcs12" I am getting this type of error with android studio 3.4 (32-bit version) at the time of generating the key, but when I am generating the same source code to apk in another laptop with android studio 3.4 (64-bit version). It works fine in 64-bit laptop and android studio. 回答1: I encountered the

Change Package Name after implementation of data binding

删除回忆录丶 提交于 2020-08-02 06:43:43
问题 I'm using Databinding with one of my project with project name com.abc.def . I've related all my views with binding like ActivityLoginBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_login); it worked fine but if I change my package name to com.Abc.Def it generated following error at the time of building Apk. Cause: couldn't make a guess for com.Abc.Def.databinding.ActivityLoginBindingImpl . Please Note : I have an old build with com.Abc.Def on playstore already live

How to grant permissions to android instrumented tests?

走远了吗. 提交于 2020-08-02 06:16:32
问题 I have an application that reads SMSs. The app works fine when debugging but when testing it using android instrumented test it throws the following error java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.SmsProvider This is my test case @RunWith(AndroidJUnit4.class) public class SmsFetcherTest { @Test public void fetchTenSms() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getContext(); // Fails anyway.

How to grant permissions to android instrumented tests?

拟墨画扇 提交于 2020-08-02 06:16:15
问题 I have an application that reads SMSs. The app works fine when debugging but when testing it using android instrumented test it throws the following error java.lang.SecurityException: Permission Denial: reading com.android.providers.telephony.SmsProvider This is my test case @RunWith(AndroidJUnit4.class) public class SmsFetcherTest { @Test public void fetchTenSms() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getContext(); // Fails anyway.