android-studio

Get file name and extension of any file in android

て烟熏妆下的殇ゞ 提交于 2020-01-30 04:04:51
问题 The issue I have, is that i can't extract the file exetension from files choosen on a smartphone with Android 9. The problem doesn't appear on devices with Android 8 or less. When the user has choosen any kind of file the onActivityResult gets called. In this method I call getPath from FileUtils class, so I can extract the file extension. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { Uri uri = new Uri.Builder().build(); if (resultCode == RESULT_OK)

error: duplicate value for resource 'attr/orientation' with config '' .aapt.v2.Aapt2Exception: Android resource compilation failed

折月煮酒 提交于 2020-01-29 06:08:42
问题 I've got this compile error! I checked similar problems on stackoverflow but all of them were about different errors & not " attr/orientation' with config '' ", but they didn't work for my problem! I'm using androidx library , kotlin ,Gradle 4.10.1 , I do these steps, but still no result: 1- Clean Project 2- Rebuild 3- Invalidate caches / Restart 4- made another attrs.xml file on the folder : res->values-v21 5-so many other ways... but all of them just failed! Any solution? 回答1: I find the

error: duplicate value for resource 'attr/orientation' with config '' .aapt.v2.Aapt2Exception: Android resource compilation failed

三世轮回 提交于 2020-01-29 06:08:04
问题 I've got this compile error! I checked similar problems on stackoverflow but all of them were about different errors & not " attr/orientation' with config '' ", but they didn't work for my problem! I'm using androidx library , kotlin ,Gradle 4.10.1 , I do these steps, but still no result: 1- Clean Project 2- Rebuild 3- Invalidate caches / Restart 4- made another attrs.xml file on the folder : res->values-v21 5-so many other ways... but all of them just failed! Any solution? 回答1: I find the

Can you install two different versions of Android Studio on the same machine?

谁都会走 提交于 2020-01-29 05:08:31
问题 I only have one machine (Mac OS 10.9.5). I currently have the canary version of Android Studio and I ran into some bug. So I want to install the stable version of Android Studio as well. Has anyone done that? Is there any issue with more than one version installed on the same machine? 回答1: Yes, but you have to alter the settings of one of the installations to point it to a different settings and cache folders. After an install, but before the first run, change the location of those folders

Can you install two different versions of Android Studio on the same machine?

自闭症网瘾萝莉.ら 提交于 2020-01-29 05:08:07
问题 I only have one machine (Mac OS 10.9.5). I currently have the canary version of Android Studio and I ran into some bug. So I want to install the stable version of Android Studio as well. Has anyone done that? Is there any issue with more than one version installed on the same machine? 回答1: Yes, but you have to alter the settings of one of the installations to point it to a different settings and cache folders. After an install, but before the first run, change the location of those folders

Android Studio Instrumentation testing build variant

扶醉桌前 提交于 2020-01-29 02:39:50
问题 So I am trying to write instrumentation tests using a custom build variant, mock. In this build variant I mocked up my classes and server. When I try using the mock build myself it works fine, but I can't seem to use my mock build for testing. Here's what my configuration looks like inside Android Studio. I had some issues getting my tests to run so I tried to uninstall all versions of my app except my mock version and I keep getting this error: Test running startedTest running failed: Unable

Error:failed to find Build Tools revision 23.0.0 rc3

风流意气都作罢 提交于 2020-01-29 00:56:16
问题 Error:failed to find Build Tools revision 23.0.0 rc3 Install Build Tools 23.0.0 rc3 and sync project. Warning: The package filter removed all packages. There is nothing to install. Please consider trying to update again without a package filter. 回答1: Solution: A) Module Settings GUI 1) Go to Module Settings -> Press F4 2) Select "app" under Modules 3) Select the "Properties" tab 4) Check the Build Tools Version values. 5) See if you find the value "23.0.0rc3" 6) If not go to select the

Does Android Studio have a Hierarchy Viewer?

若如初见. 提交于 2020-01-26 23:54:33
问题 I tried searching on here but couldn't find the answer. I'm looking for a way to launch the Hierarchy Viewer from within Android Studio, rather than having to launch it at the command-line. I've recently migrated to Android Studio from Eclipse, and this functionality was available under the DDMS set of tools in that IDE. I've looked under the "Android" toolbar, and can see the screen-shot functionality there, but not the hierarchy viewer. I've also looked under Tools > Android in the menu

How to build a 'release' APK in Android Studio?

别来无恙 提交于 2020-01-26 21:52:33
问题 I am trying to build an APK that I can upload to the Play Store. When I select Build|Generate Signed APK... in Android Studio (version 0.3.1), I am directed to a link on how to properly set up the signing process in the "gradle build scripts": http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations Unfortunately, after checking that page I'm at a loss as to what file to edit and what to put in it - I'm coming from a Visual Studio background, so lazily expect

My device didn't show allow usb debugging dialog

谁说我不能喝 提交于 2020-01-26 04:15:29
问题 In this pitcher My android studio shows allow usb debugging from your device , but my device does not showing that dialog. I have tried this: adb kill-server 2. abd start-server 3. kill adb process from task manager 4. restarted computer and device both 5. in my device's usb debugging setting there is MTP usb debugging configuration selected, i have tired PTP too. Nothing works i cant see the allow dialog in my device. 回答1: Can you Please Following Below step: 1) Go to Phone Setting >