android-studio

Can I change the default layout in Android Studio?

可紊 提交于 2020-01-14 02:06:05
问题 When I create a new project with a Blank Activity in Android Studio, it uses a RelativeLayout by default. I'd like to change that Blank Activity default to LinearLayout, rather than editing each activity - is that possible? 回答1: I have already answered this question here: How to change a default template files in Android Studio. Basically you need to look at the recipe_fragment.xml.ftl file, so you, know which files are used for the template. The default template files are located in: ...

Android Studio 3.0: Unable to resolve module dependency

早过忘川 提交于 2020-01-13 20:21:07
问题 I have a one main project and second project (module). After I import the module project as a module dependency into app project and try to sync everything, I get the following error: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :module. Could not resolve project :module. Required by: project :app Unable to find a matching configuration of project :module: - Configuration 'debugApiElements': - Required com.android.build.api.attributes.BuildTypeAttr

Picasso showing blue red and green arrows on top corner

こ雲淡風輕ζ 提交于 2020-01-13 20:19:53
问题 I am using picasso to fire up an image in imageView. Here is the code ImageUtils.setImageFromUrl(app.selectedRing.getMainPicture(), imageView, MainActivity.this); public static void setImageFromUrl(final String url, final ImageView imgView, final Context mContext) { Picasso.with(mContext) .load(url) .networkPolicy(NetworkPolicy.OFFLINE) .fit().centerInside().placeholder(null) .into(imgView, new Callback() { @Override public void onSuccess() { } @Override public void onError() { Picasso.with

android studio 2.2.1 cannot resolve symbol *

久未见 提交于 2020-01-13 19:40:48
问题 I use android-studio 2.1.1 in the past, yesterday I downloaded android-studio 2.2.1, but found cannot resolve symbol error, now I use android-studio 2.1.1 and everything is ok, I have already tried : 1、File->Invalidata Caches/Restart->Invalidata and Restart 2、Build->Make Module 3、Build->Make Project 4、Build->Clean Project 5、Build->Rebuild Project can anyone help me , thanks in advance. 回答1: I encountered the same problem as you. Google released android studio 2.2 preview 2 today - I

Android studio project not compiling after updating firebase-perf plugin (Class module-info is missing)

只愿长相守 提交于 2020-01-13 19:28:08
问题 everyone. I'm using gradle version 5.6.2. I updated my android studio project dependencies like this: dependencies { classpath 'com.android.tools.build:gradle:3.5.1' classpath 'com.google.gms:google-services:4.3.2' classpath "com.google.firebase:perf-plugin:1.3.1" } I apply the plugins like this: apply plugin: 'com.google.firebase.firebase-perf' apply plugin: 'com.google.gms.google-services' But now when I compile my project this error shows up: Illegal class file: Class module-info is

Unable to start emulator on Android Studio 2.1

不打扰是莪最后的温柔 提交于 2020-01-13 19:12:32
问题 I am unable to start my emulator on Android Studio 2.1 and getting the following error : Cannot launch AVD in emulator. Output: emulator: WARNING: Increasing RAM size to 1024MB init: Could not find wglGetExtensionsStringARB! getGLES1ExtensionString: Could not find GLES 1.x config! emulator: WARNING: VM heap size set below hardware specified minimum of 48MB Failed to obtain GLES 1.x extensions string! emulator: WARNING: Setting VM heap size to 256MB Hax is enabled Hax ram_size 0x40000000 HAX

Unable to start emulator on Android Studio 2.1

三世轮回 提交于 2020-01-13 19:11:49
问题 I am unable to start my emulator on Android Studio 2.1 and getting the following error : Cannot launch AVD in emulator. Output: emulator: WARNING: Increasing RAM size to 1024MB init: Could not find wglGetExtensionsStringARB! getGLES1ExtensionString: Could not find GLES 1.x config! emulator: WARNING: VM heap size set below hardware specified minimum of 48MB Failed to obtain GLES 1.x extensions string! emulator: WARNING: Setting VM heap size to 256MB Hax is enabled Hax ram_size 0x40000000 HAX

Refactoring inside the main source set doesn't propagate to inactive build variants

*爱你&永不变心* 提交于 2020-01-13 18:56:26
问题 I have src/main/java for the main source set. Also a src/heroes/java source set for a product flavor named heroes and a src/villains/java source set for a product flavor named villains . Those have only a single build type, debug . Meaning the build variants pane will contain heroesDebug and villainsDebug . Now, in Android Studio, if I select build variant heroesDebug , src/main and src/heroes become "active" while src/villains "deactivates". Meaning I can use ALT + Insert, code complete, and

Refactoring inside the main source set doesn't propagate to inactive build variants

主宰稳场 提交于 2020-01-13 18:56:25
问题 I have src/main/java for the main source set. Also a src/heroes/java source set for a product flavor named heroes and a src/villains/java source set for a product flavor named villains . Those have only a single build type, debug . Meaning the build variants pane will contain heroesDebug and villainsDebug . Now, in Android Studio, if I select build variant heroesDebug , src/main and src/heroes become "active" while src/villains "deactivates". Meaning I can use ALT + Insert, code complete, and

Migrating from Eclipse to Android-Studio (gradle)

 ̄綄美尐妖づ 提交于 2020-01-13 18:30:13
问题 I'm trying to migrate my applications to use gradle, but I'm facing some problems including library projects. My project tree is this: My projects root - MyLib1 -- res -- src -- libs - MyLib2 -- res -- src -- libs - MyLib3 -- res -- src -- libs - MyAppBase -- res -- src -- libs - MyApp - full version -- res -- src -- libs - MyAppFree - free version -- res -- src -- libs With Eclipse I had the following dependencies MyAppBase depends on: -MyLib1 -MyLib2 -MyLib3 MyApp depends on: -MyAppBase