android-studio

Can't find resource identifiers from AAR in XML

懵懂的女人 提交于 2020-01-09 11:11:50
问题 I developed a custom Preference for an application. It has two custom attributes. I'm trying to move the Preference to a library project to reuse in other projects. I moved the Java file along with the corresponding layout and attr XML files. Here's the attr file in the library project: <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="NumberPickerPreference" > <attr name="minValue" format="integer" /> <attr name="maxValue" format="integer" /> </declare-styleable> <

Android takes more time on application start up during first time launch

蓝咒 提交于 2020-01-09 10:02:43
问题 In my project, I have used libraries which require multidex support. Based on the research I did, I came to know that it causes delay during app start up. I have enabled multidex feature in gradle. defaultConfig { multiDexEnabled true } I used to get NoClassDefFound Exception for kitkat devices so I added the following: I have added application name in manifest as android:name="android.support.multidex.MultiDexApplication" and extended my application class with MultiDexApplication. I know any

Android takes more time on application start up during first time launch

我的未来我决定 提交于 2020-01-09 10:01:07
问题 In my project, I have used libraries which require multidex support. Based on the research I did, I came to know that it causes delay during app start up. I have enabled multidex feature in gradle. defaultConfig { multiDexEnabled true } I used to get NoClassDefFound Exception for kitkat devices so I added the following: I have added application name in manifest as android:name="android.support.multidex.MultiDexApplication" and extended my application class with MultiDexApplication. I know any

Invalid SplitApkBundle. The bundle targets unknown languages: [gr]. google play console

余生颓废 提交于 2020-01-09 09:58:26
问题 Android app bundle upload failed with error Invalid SplitApkBundle. The bundle targets unknown languages: [gr] Android Studio version 3.5 I tried Clean & rebuild Invalidate cache/restart 回答1: I had the same issue. Invalid SplitApkBundle. The bundle targets unknown languages:[cb] I solved by setting DSL to stop aapt package building the wrong language targets. My app supports English and Chinese, therefore resConfigs only needs en and zh. defaultConfig { ... resConfigs "en", "zh-rTW", "zh-rCN"

Android Studio Build/Clean

做~自己de王妃 提交于 2020-01-09 09:22:40
问题 In an attempt to compile external jars, I have to use the terminal and do a clean. However, when I go into the root directory of my project and execute gradlew clean I get the following message: -bash: gradlew: command not found Here's a screenshot of my application folder's home directory. Let me know if you need anything else, I'm not sure why this is happening. 回答1: gradlew is not in your global path. To execute the 'clean' task (or any task for that matter) using the gradle wrapper

Android Studio local path doesn't exist

廉价感情. 提交于 2020-01-09 07:35:09
问题 I imported my Eclipse project into Android using Gradle. At first I had problems with R.java but I resolved them by adding 'gen' folder as sources in Project Settings. However, even though Android Studio doesn't show any errors any more, when I'm trying to deploy the project onto my Android device, I get the error: Waiting for device. Target device: 01c47c94e112d5fb Uploading file local path: C:\Users\Szymon\Eclipse\Android App\build\apk\Android App-debug-unaligned.apk remote path: /data

Run an app on a multiple devices automatically in Android Studio

倖福魔咒の 提交于 2020-01-09 07:07:54
问题 I have a multiple Android devices connected to the computer. When I try to run the app I'm developing, the Android Studio always prompt me to choose the device. Is there any way to deploy the app on a multiple devices automatically - by clicking Run or even better with a shortcut? 回答1: This is almost too easy, actually. When you see the list of devices come up after launching the app, just shift or control click each device you want it to launch on. Just discovered this by accident. Hope it

Run an app on a multiple devices automatically in Android Studio

余生长醉 提交于 2020-01-09 07:05:29
问题 I have a multiple Android devices connected to the computer. When I try to run the app I'm developing, the Android Studio always prompt me to choose the device. Is there any way to deploy the app on a multiple devices automatically - by clicking Run or even better with a shortcut? 回答1: This is almost too easy, actually. When you see the list of devices come up after launching the app, just shift or control click each device you want it to launch on. Just discovered this by accident. Hope it

Add commons-io dependency to gradle project in Android Studio

廉价感情. 提交于 2020-01-09 04:52:26
问题 Very simple question - how to add commons-io dependency to gradle Android project? I tried the following buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' dependencies { compile files('libs/android-support-v4.jar') compile group: 'commons-io', name: 'commons-io', version: '2.0.1' } but it does not work The error is Gradle: A problem occurred configuring project ':LearnIt'. Failed to notify project

How can I open front camera using Intent in android?

北城以北 提交于 2020-01-09 03:51:06
问题 I want to make a app in which I have to open only front camera, How can i do it using intent ? private void captureImage() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); intent.putExtra("android.intent.extras.CAMERA_FACING", 1); // start the image capture Intent startActivityForResult(intent, CAMERA_CAPTURE_IMAGE_REQUEST_CODE); } 回答1: java Intent intent = new Intent(MediaStore