android-studio-2.1

Android Studio: 'sudo' is not recognized as an internal or external command, operable program or batch file

a 夏天 提交于 2019-12-12 02:30:06
问题 As a possible solution to my Android Studio "could not expand zip" problem, I would like to run this command from the Terminal window in Android Studio: sudo chmod -R 777 /your/project/path However, when I try it, I get this error: 'sudo' is not recognized as an internal or external command, operable program or batch file. How to solve? (I am running Android Studio 2.1.2 on Windows 7.) 回答1: sudo is a *nix utility, not something you'll find on Windows. Ditto chmod . With that said, the command

Cannot Resolve Symbol 'App'

孤街浪徒 提交于 2019-12-12 02:10:02
问题 So I forced Android Studio to stop in the middle of stopping a gradle build (I know, how idiotic of me) because it was taking forever and it kept not responding and when I opened it back up it was okay and I could create a new layout file but when I created a new java class it decided it didn't like importing android.support.v7.app.AppCompatActivity in any of my java classes (but if I don't open them to look at them, there is no red squiggly underline) and it says that it "cannot resolve

Android studio doesn't start on windows Error invoking main method

时间秒杀一切 提交于 2019-12-11 13:38:24
问题 Android Studio is not starting.when I click to open it gives me below error.Any suggestion for error. I have already set the environment variable[ANDROID_HOME,JAVA_HOME,JDK_HOME]. 回答1: In my case, it happened because the idea.properties file in the bin directory was missing. I simply restored it with a backup version I had and Android Studio worked again. I was running on Windows 64 bit with Android Studio version 2.2.1. I think the file went missing in the first place because I modified the

exportedHeaders DSL does not seem to include the headers

不问归期 提交于 2019-12-11 13:11:54
问题 I am trying to make use of the "Multiple NDK Projects" feature of the experimental gradle plugin. I am using Android Studio 2.1 and gradle plugin 0.7.0 stable. The blog seems to say that the header files specified in the exportedHeaders section of the native library will be included during compilation exportedHeaders { srcDir "src" } This does not seem to work for me. Say for example I have the following folder structure, I would expect Addition.h to be available in native.cpp, ie I should be

Marshmallow permission

帅比萌擦擦* 提交于 2019-12-11 06:37:53
问题 I'm trying to check permission in activity as below, int permission = ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNT); But I'm getting error at GET_ACCOUNT as Cannot resolve symbol 'GET_ACCOUNT' . Kindly help what code should I add to fix this? Thanks in advance. 回答1: It should be Manifest.permission.GET_ACCOUNTS instead of Manifest.permission.GET_ACCOUNT Try like this int permission = ContextCompat.checkSelfPermission(this,Manifest.permission.GET_ACCOUNTS); Don't

errors with gradle in android studio

会有一股神秘感。 提交于 2019-12-11 00:52:51
问题 I am trying to build the project and run it in my google glass but when ever i am trying to build it is showing that Error:(20, 0) Gradle DSL method not found: 'runProguard()' Possible causes: The project 'gdk-stopwatch-sample' may be using a version of Gradle that does not contain the method. Gradle settings The build file may be missing a Gradle plugin. Apply Gradle plugin but i have installed the latest gradle plugin i.e 2.13, changed the classpath in build.gradle to 'com.android.tools

Findbugs fails with “java.io.IOException: No files to analyze could be opened”

血红的双手。 提交于 2019-12-10 09:59:38
问题 I run an Android Studio v2.1.3 and use ./gradlew build to detect errors in the Android project with the Findbags. Recently an error started to come up: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':process:customFindbugs'. > java.io.IOException: No files to analyze could be opened There are enough disk space and RAM and beside that I don't see any particular reason for that error to occur. Please help to elaborate on this problem. 回答1: If you use 3.2,

Is there a way to extract a string with an automatically generated resource name for a java file in Android Studio?

无人久伴 提交于 2019-12-08 07:10:40
问题 In Android Studio, Alt + Enter > "Extract String Resource" in a java file will open the following window: Please note that the Resource name field is blank. However, the window will be like the following for a layout XML file: Please note the Resource name field is filled automatically. How can the Resource name field be filled with an automatically generated name for java files too? It thought the Resource name was filled automatically for all types of files before the current version of

Decreasing android studio 2.1 build time

萝らか妹 提交于 2019-12-07 04:50:04
问题 I was using android studio 1.5 earlier and i just upgraded to 2.1.But after the update my builds are taking much more time(from 15 sec to 2 min now) Things I have tried as mentioned here Enabled offline work in Settings org.gradle.daemon=true org.gradle.parallel=true in gradle.properties file @ C:\Users\.gradle (Windows) But still no difference. How can I reduce the build time? 回答1: From official source: Windows defender real time protection is causing instant run slow downs. Add your project

JVM arguments gradle cannot be set in gradle.properties file for Android Studio 2.1.1

强颜欢笑 提交于 2019-12-06 19:06:33
问题 -Running Android 2.1.1 on Mac OS X -App is not on Android phone. content of gradle.properties file org.gradle.jvmargs=-Xmx2048M When hovering, the IDE indicates it is an unused property . It should also be dark blue instead of grey. Output: :MyProjectDirName:transformClassesWithInstantRunSlicerForDebug :MyProjectDirName:transformClassesWithDexForDebug To run dex in process, the Gradle daemon needs a larger heap. It currently has approximately 910 MB. For faster builds, increase the maximum