android-studio

Unresolved reference: JavaVersion.VERSION_1_8

﹥>﹥吖頭↗ 提交于 2020-01-13 08:17:08
问题 How to fix the following error? android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ... } Android Studio --> File --> Project Structure --> Modules --> Unresolved reference: JavaVersion.VERSION_1_8 回答1: I added to the buildscript section of the root build.gradle the ext.java_version variable buildscript { ... ext.java_version = JavaVersion.VERSION_1_8 ... } and changed in the module's build.gradle JavaVersion.VERSION_1_8 to

Unresolved reference: JavaVersion.VERSION_1_8

僤鯓⒐⒋嵵緔 提交于 2020-01-13 08:16:17
问题 How to fix the following error? android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ... } Android Studio --> File --> Project Structure --> Modules --> Unresolved reference: JavaVersion.VERSION_1_8 回答1: I added to the buildscript section of the root build.gradle the ext.java_version variable buildscript { ... ext.java_version = JavaVersion.VERSION_1_8 ... } and changed in the module's build.gradle JavaVersion.VERSION_1_8 to

Gradle Build Error: Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml

微笑、不失礼 提交于 2020-01-13 07:57:51
问题 I am getting a gradle build error in Android studio as below: Error:A problem occurred configuring project ':MyApp'. Could not resolve all dependencies for configuration ':MyApp:classpath'. Could not resolve io.fabric.tools:gradle:1.+. Required by: sw-android:MyApp:unspecified Failed to list versions for io.fabric.tools:gradle. Unable to load Maven meta-data from https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml. Could not GET 'https://repo1.maven.org/maven2/io/fabric

SearchView query hint before clicking it

为君一笑 提交于 2020-01-13 07:49:27
问题 I have a search view and I have a query hint attribute. However the hint appears only after clicking on the search view. Is there a way to make it appear before it has been clicked? <SearchView android:id="@+id/searchView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:layout_alignParentStart="true" android:layout_below="@+id/textView4" android:layout_marginBottom="14dp" android:layout_marginTop="30dp" android:queryHint=

Cannot resolve symbol 'NonNull' after Android Studio update

拜拜、爱过 提交于 2020-01-13 07:36:30
问题 I recently updated Android Studio. Afterwards it seems to no longer being able to resolve some support annotations, such as @NonNull or @Nullable . It did work just fine before updating. However, everything is still compiling and I am able to execute Code, but still it shows the symbol cannot be resolved message at my imports. What I have already tried so far: Included the dependency in build.gradle (Module: Application): compile 'com.android.support:support-annotations:27.0.0' I have

Details of connected users to mobile hotspot

为君一笑 提交于 2020-01-13 06:47:12
问题 If I've enabled Wi-Fi Hotspot in my android phone and 2 other android phones are connected to my Hotspot, then how can I distinguish between each phone? Does my phone distinguish between the different phones using IEMI numbers or something else? 回答1: 1) You can use BroadcastReciever "android.net.wifi.WIFI_HOTSPOT_CLIENTS_CHANGED" to detect client connection. In your AndroidManifest: <receiver android:name=".WiFiConnectionReciever" android:enabled="true" android:exported="true" > <intent

HAXM is required to run this AVD

…衆ロ難τιáo~ 提交于 2020-01-13 05:48:20
问题 I have created emulator in android studio and create little application in it. When i run it gives me an error[See image 1]. When i googled, it told me that your system does not support virtualization. But my system suport it. [See image 2]. Now my question is that when my system support virtualization then why i cannot run my app in emulator. Also please help on this following error too. 1-Intel HAXM is required to run this AVD. 2-Your CPU does not support NX. Please anyone help to resolve

My Android SDK takes up too much space, and .temp directory takes up 90+ GB of space. What does the .temp directory do?

痞子三分冷 提交于 2020-01-13 05:46:10
问题 I was alarmed when I checked the amount of storage my "System" files took up on my Mac: So I went into /Users/[User]/Library/Android and saw that my SDK took up 150+ GB of space! So I got the info of all the files inside of the SDK but saw that they clearly do not add up to 152.64 GB. Then I used Cmd+Shift+Dot(.) to show all of my hidden files and saw that this .temp directory took up 91.89 GB of space. So my question is, what is it for? 回答1: I have found the answer: Turns out the .temp

Android: Emulator factory data reset menu option not working

拜拜、爱过 提交于 2020-01-13 04:31:10
问题 I'm attempting to test a new Android system level app of my own creation, that catches various system event hooks after a device factory reset has been performed. Through the Android Studio AVD Manager i have created multiple emulated Android TV Devices, flavours Oreo (8.0.0) and Pi (9.0) but none of them allow a successful factory reset to be applied. The steps i've have carried out: Launch the freshly created emulated device (with the system partition writable option) eg. ~/Android/Sdk

Android: Emulator factory data reset menu option not working

a 夏天 提交于 2020-01-13 04:31:02
问题 I'm attempting to test a new Android system level app of my own creation, that catches various system event hooks after a device factory reset has been performed. Through the Android Studio AVD Manager i have created multiple emulated Android TV Devices, flavours Oreo (8.0.0) and Pi (9.0) but none of them allow a successful factory reset to be applied. The steps i've have carried out: Launch the freshly created emulated device (with the system partition writable option) eg. ~/Android/Sdk