android-studio

RxAndroid `Observable…subscribe` highlighted in Android Studio

与世无争的帅哥 提交于 2020-01-16 06:06:10
问题 I'm using RxAndroid to marshal a string from a background thread into the main thread, and do something with that string on that main thread: String stringFromDatabase = readFromDatabase(); Observable.just(stringFromDatabase) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Consumer<String>() { @Override public void accept(String string) throws Exception { webViewFragment.onInjectMessage(string, null); } }); Android Studio is highlighting the entire Observable.just... command chain

which cmake will Android plugin use?

牧云@^-^@ 提交于 2020-01-16 05:09:08
问题 With Android Studio 3.3 I use native (C++) library, which I built with CMake. The Android plugin (v. 3.2.1) will choose the 'builtin' or 'external' cmake, depending on the configuration of externalNativeBuild , as documented at developer.android.com. I want to add an extra custom task (install) that should use the same cmake version as the Android Plugin. But even with the 'builtin' cmake, it's not clear what the path is. I can find android.sdkDirectory , but even there I have today sdk\cmake

AndroidX - Program type already present: androidx.annotation.BoolRes

佐手、 提交于 2020-01-16 04:45:08
问题 I tried to migrate my current project today to AndroidX using the "Refactor - > Migrate to AndroidX" option in Android Studio and whenever I try to compile my application, I receive a Program type already present: androidx.annotation.BoolRes AGPBI: {"kind":"error","text":"Program type already present: androidx.annotation.BoolRes","sources":[{}],"tool":"D8"} :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED :app:buildInfoGeneratorDebug FAILURE: Build failed with an exception. *

I can't import java.util.date in activity

半世苍凉 提交于 2020-01-16 04:17:19
问题 In my project I need to to use current date and time. For this I'm importing java.util.Date. This import is working fine few hours ago. But I have an error in R file ( r cannot resolve ) and this error is because of some xml mistake. When I resolved that issue and sync project again that error is gone. But after that I cannot able to import (java.util.Date , java.util.Calendar) in any of my project. I tried to import this in my newly created project. But still not found java.util.Date. Even

Android Studio “Invalid hash string” warning in Compile Sdk Version

吃可爱长大的小学妹 提交于 2020-01-16 03:39:22
问题 I'm very new at Android app development and trying to apply some changes on an existing project. When I try to change the Compile Sdk Version in Project Structure in Android Studio, it displays a red warning (Invalid hash string) on the right side of the chosen Sdk "Vuzix Corporation:Vuzix M300 SDK:23" and doesn't apply the changes. And then I realised the same also happens for "Google Inc.:Google APIs:23". It's an app built for Vuzix M300 augmented reality glasses and I followed the

ADB is not starting no any error message

非 Y 不嫁゛ 提交于 2020-01-16 00:58:10
问题 Have searched about this issue, but nothing helped. When i want to run my application in Android Studio(v1.2.2), window with text "Waiting for adb" appears. In 30 seconds opens another window with error "ADB is not responding,if you want to retry please kill adb manually and click Restart". It doesn't helps. When i want to run adb start-server manually it doesn't show any message "./adb start-server " It is output in my terminal. What i'm doing wrong? output of adb: "ddms: Unable to run 'adb'

How to get rid of this error Failed processing manifest?

僤鯓⒐⒋嵵緔 提交于 2020-01-16 00:46:30
问题 I got the above error when I changed minsdk to 21 and targetsdk to 23 both from API 26. It also shows some warnings like minsdkVersion (28) is greater than targetsdkversion (23) for variant release. What is the issue? 回答1: There are two build.gradle files that you need to make sure their version is the same as your AndroidManifest.xml , one is in root directory of the project, which should be having lines containing defaultMinSdkVersion and defaultTargetSdkVersion . The other is inside your

How to get rid of this error Failed processing manifest?

时光毁灭记忆、已成空白 提交于 2020-01-16 00:46:24
问题 I got the above error when I changed minsdk to 21 and targetsdk to 23 both from API 26. It also shows some warnings like minsdkVersion (28) is greater than targetsdkversion (23) for variant release. What is the issue? 回答1: There are two build.gradle files that you need to make sure their version is the same as your AndroidManifest.xml , one is in root directory of the project, which should be having lines containing defaultMinSdkVersion and defaultTargetSdkVersion . The other is inside your

Android error Attempt to invoke virtual method on a null object reference [duplicate]

丶灬走出姿态 提交于 2020-01-15 17:38:34
问题 This question already has answers here : I would like to set my variables at the top of my class instead of in the method (4 answers) Closed 4 years ago . I'm new to Android Studio (and am hating the transition experience from Eclipse). I'm trying to write an app that currently has two activities. I already wrote the Java code for the main logic and it works fine, but haven't put it in the second activity yet. As I'm trying to write and run the app, it gives me an error. There's a

Android error Attempt to invoke virtual method on a null object reference [duplicate]

瘦欲@ 提交于 2020-01-15 17:35:29
问题 This question already has answers here : I would like to set my variables at the top of my class instead of in the method (4 answers) Closed 4 years ago . I'm new to Android Studio (and am hating the transition experience from Eclipse). I'm trying to write an app that currently has two activities. I already wrote the Java code for the main logic and it works fine, but haven't put it in the second activity yet. As I'm trying to write and run the app, it gives me an error. There's a