Posts

Showing posts with the label Android Studio

Auto Import Not Working For Android Classes In Android Studio

Answer : The problem was with android studio indexing. Follow the steps.. Go to 'File' > 'Invalidate caches/restart' Now the studio will shut down and restart. Now indexing begins. On completion of indexing you will find the Suggestion boxes with every possible suggestions. For me, the problem was that "Show import popup" was not checked at File > Settings > Editor > General > Auto Import > Java.

Android Studio Design Editor Is Unavailable Until After A Successful Project Sync

Answer : Just sync your project with gradles. File --> Sync Project with Gradle Files Build -> Clean Project Build -> Rebuild Project File -> Sync project with gradle files . If not worked then try File -> Invalidate Caches / Restart . It's work for me !!!

Android Studio Database Inspector Does Not Show Any Databases

Answer : In my case, it showed me the same process a lot of times. And none of them worked. The solution was Invalidating the Cache: File -> Invalidate Caches/Restart -> Invalidate and restart After that everything started working again. I face 2 cases: First time connect to my device and database does not show, then i do an action to modify database -> database will show. After I use ADB Idea to clean app data or uninstall (or go to settings and clear cache or uninstall app) -> database does not show -> restart device -> database will show Looks like its problem with device . If you have some custom rom installed then you might run into this issue . Link to the issue tracker https://issuetracker.google.com/issues/159432618

Cannot Enable Gradle's Offline Mode On Android Studio 3.6

Image
Answer : From the Android Studio 3.6 new features blog post: New location to toggle Gradle's offline mode To enable or disable Gradle's offline mode, first select View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.. Here is the link -- hope that helps! To enable or disable Gradle's offline mode, select View > Tool Windows > Gradle from the menu bar and near the top of the Gradle window, click Toggle Offline Mode To clarify it. In your Android Studio... View > Tool Windows > Gradle And then this... And this...

Android Studio Emulator Does Not Come With Play Store For API 23

Image
Answer : I've had to do this recently on the API 23 emulator, and followed this guide. It works for API 23 emulator, so you shouldn't have a problem. Note: All credit goes to the author of the linked blog post (pyoor). I'm just posting it here in case the link breaks for any reason. .... Download the GAPPS Package Next we need to pull down the appropriate Google Apps package that matches our Android AVD version. In this case we’ll be using the 'gapps-lp-20141109-signed.zip' package. You can download that file from BasketBuild here. [pyoor@localhost]$ md5sum gapps-lp-20141109-signed.zip 367ce76d6b7772c92810720b8b0c931e gapps-lp-20141109-signed.zip In order to install Google Play, we’ll need to push the following 4 APKs to our AVD (located in ./system/priv-app/): GmsCore.apk, GoogleServicesFramework.apk, GoogleLoginService.apk, Phonesky.apk [pyoor@localhost]$ unzip -j gapps-lp-20141109-signed.zip \ system/priv-app/GoogleServicesFramework/GoogleSer...

AndroidX : Parcelable Encountered IOException Writing Serializable Object Only In Android Version 10 Devices

Answer : Here Is Your Solution : transient is a variables modifier used in serialization. At the time of serialization, if we don't want to save value of a particular variable in a file, then we use transient keyword. When JVM comes across transient keyword, it ignores original value of the variable and save default value of that variable data type. So, it uses quite rare in order to say to your compiler that this variable is not a part of serializable mathod.

Android Studio 2.2.2: All Packages Are Not Available For Download

Answer : I was facing the same issue. For me, it got resolved by setting proxy settings. Android Studio > File > Settings >appearance and behavior> System Settings > HTTP Proxy I would suggest checking any proxy is required to enable internet for your android studio. Hope this will help somebody. Open Android SDK Manager Click on Tools. Click on Android. Click on SDK Manager. Update your SDK's Then Sync ,Re-Build and Restart Your Project "Launch Standalone SDK Manager" is not available in newer versions. Just select "SDK Tools" tab, then "Android SDK Build-Tools and place a check next to 23.0.1, 23.0.2, 23.0.3, etc. and any others you may want to install. Select Apply and when complete, press Finish. Rebuild and see if that helps.

Android Studio Rendering Problems

Image
Answer : Change your android version on your designer preview into your current version depend on your Manifest. rendering problem caused your designer preview used higher API level than your current android API level. Adjust with your current API Level. If the API level isn't in the list, you'll need to install it via the SDK Manager. In new update android studio 2.2 facing rendering issue then follow this steps. I fixed it - in styles.xml file I changed "Theme.AppCompat.Light.DarkActionBar" to "Base.Theme.AppCompat.Light.DarkActionBar" It's some kind of hack I came across a long time ago to solve similar rendering problems in previous Android Studio versions. Open AndroidManifest.xml Change: android:theme="@style/AppTheme" to something like: android:theme="@style/Theme.AppCompat.Light" Hit "refresh" button in the "Previev" tab.

Android Studio Doesn't See Device

Answer : I recently had trouble with this, and regardless of what I did(restart adb, edit adb_usb.ini, restart computer+device+swap usb port, reinstall studio etc. etc.) I just couldnt get it to work, and could not even detect my device using 'adb devices'. Finally after about 2 hours of googling and testing, someone suggested switching to PTP instead of MTP on my device. When I did this I got a popup on my device asking me to allow my mac access and suddenly everything worked(had to restart studio for it to show up there as well though). I might be bumping this thread now, but it is the first result on google search, and I had a lot of trouble finding an answer for this problem, so I thought this should be added as a solution. On your device: Go to settings/ developer settings/ allow USB debug mode If 'allow USB debug mode' option is disabled. Then you might have the device currently connected to your PC. Disconnect the device and the option should now...

Android Studio 3.2.1 - Cannot Sync Project With Gradle Files: Argument For @NotNull Parameter 'message' Of ... Must Not Be Null

Answer : Ok, I was finally able to figure out the reason. The problem was, that my project folder resided on a different hard disk partition, than my home folder. The folder containing my android projects was linked to my home folder with a symbolic link. I can't tell whether its the symbolic link, or the other partition, that is causing the problem. I haven't checked that. Maybe it works if you have it on the same partition but linked with a symbolic link. Maybe it works when used on another partition without symbolic links. But for anyone experiencing this problem -> Check if one of these might be your cause as well. Some extra information: My android project folder resided on a hard disk partition formatted with ZFS. I saw a version of this with just now on Android Studio 3.4: the only error message I saw in the IDE was that Gradle sync failed, but in idea.log there was a NullPointerException and its traceback originated at com.intellij.openapi.extensions.Exte...

Android Studio Emulator And AMD CPU

Image
Answer : If you have an AMD processor, you can download an ARM image, but it is super slow on x86 platforms. The x86 image does not work with AMD CPUs, because the x86 image needs HAXM installed which needs VT-X support, and only Intel CPUs support it. So you can download the Genymotion emulator, which supports both VT-X & AMD-V technology. Genymotion is super fast. Other than hooking your physical device up to test, it's the next best thing. Android Studio emulator is not efficient for testing. I am using the personal version of Genymotion. With the latest API 30, even x86 emulators are very fast in AMD processors. For this in Windows, you follow this below. You absolutely don't need Intel HAXM (Hardware Accelerated Execution Mode) in AMD processors, because they are AMD processors. Just enable (check) Windows Hypervisor Platform in Windows features as shown below. Now, you can start emulators. No need of Intel HAXM. Here is official link: https://android-deve...

Android Studio 3.3 RC3 Theme Editor Missing

Image
Answer : According to this issue, the Theme Editor has been disabled. The fact that you get something with the double-shift search option suggests that there is a bug somewhere, as if the Theme Editor is an ex-feature, it should not show up in searches either. Theme Editor is still missing in 3.5 edition. The fact that it hasn't made itself back in makes me think it's been permanently cut. A real shame when there is not a good replacement. It's still possible to edit the theme directly through the styles.xml file, but you will need to look up the syntax yourself for each component. This article does reference the name of several of the components as well as what they are in project: http://www.informit.com/articles/article.aspx?p=2467490&seqNum=5 Android Studio 3.4 for Mac still doesn't have Theme Editor back. Alternative way can be like, In ' values/styles.xml ', you can see soft coded theme colors. It can be changed in ' values/colors.xml ...

Android Studio: Server's Certificate Is Not Trusted

Answer : Android Studio has a configuration for Server Certificates (This works for other IntelliJ platforms like PyCharm as well) Go to File->Settings . In the IDE Settings section select Server Certificates Myself I just selected the Accept Automatically check box, hit Apply and never had to deal with it. If you are worried about security, there is also the option to add them 1 at a time as they come up. In my case I did this because I already had a *.google.com certificate configured as accepted, but I still got the popup. I suspect that the fingerprint changed and if I would have deleted and then accepted the error would have gone away, but I decided to just make it go away by selecting the check box. It is not safe to ignore that warning. Someone could be attempting a man-in-the-middle attack with a fake certificate in order to install malicious software on your computer through the update process. This probably isn't happening but it's always better to do...

Can't Install Android Emulator For AMD Processors

Answer : I found the answer after long time. I had to enable Virtualization on my machine. If you are using Avast antivirus (Or AVG), The problem may be in it. So things to do to fix this: -Activate Virtualization in bios -Deactivate Hyper-v and hypervisor platform in "activate/desactivate windows function" & run powershell as admin and make :"Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V" -In Avast Antivirus. In settings click Troubleshoot on the left side of the screen, uncheck the box next to Enable hardware assisted virtualization, then click OK to confirm and restart your computer I've got the solution from https://github.com/google/android-emulator-hypervisor-driver-for-amd-processors/issues/10#issuecomment-715423881 If You are using AMD Ryzen Just go to bios setting check for SVM Mode if it is Disabled then Enable it .. Emulator work perfectly..Below Link show where to enable SVM Mode in Aorus Gigabyte Motherboard BIO...

Android Icon Generator For Actionbar And Notification Not Working (grey Shape)

Image
Answer : You can use a tool for creating generic icons in Asset Studio: https://romannurik.github.io/AndroidAssetStudio/icons-generic.html. To get it look like ActionBar Icon, you should make next actions: Choose image The size of image should stay at 24dip Change padding to 4dip Move foreground color thumb to 0% That's it! Download .zip now. The sizes of icons will be pretty the same as you can get them with ActionBar Icon Generator. How it looks for me: I think it's because your image is too complexe and the main problem is the "color" filter applied in AAS. I had the same problem and I had to convert xxxhdpi xxhdpi etc. manually. If you work with Sketch (for example) it can be converted easily with a plugin (https://github.com/zmalltalker/sketch-android-assets) hope it's help ! If you want to use AAR, like @rom4ek explained "4. Move foreground color thumb to 0%" this is the important part

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools

Answer : As the warning message states, the SDK location should not contain whitespace. Your SDK is at C:\Users\Giacomo B\AppData\Local\Android\sdk . There is a whitespace character in Giacomo B . The easiest solution is to move the SDK somewhere else, where there is no space or other whitespace character in the path, such as C:\Android\sdk . You can point both Android Studio installations to the new location. There is another way: Open up CMD ( as Administrator ) Type: mklink /J C:\Program-Files "C:\Program Files" ( Or in my case mklink /J C:\Program-Files-(x86) "C:\Program Files (x86)" ) Hit enter Magic happens! ( Check your C drive ) Now you can point to C:\Program-Files ( C:\Program-Files-(x86) ). just change the path: "c:\program files\android\sdk" to "c:\progra~1\android\sdk" or "c:\program files (x86)\android\sdk" to "c:\progra~2\android\sdk" note that the paths should not contain spaces.

Android Studio : How To Uninstall APK (or Execute Adb Command) Automatically Before Run Or Debug?

Answer : adb uninstall <package_name> can be used to uninstall an app via your PC. If you want this to happen automatically every time you launch your app via Android Studio, you can do this: In Android Studio, click the drop down list to the left of Run button, and select Edit configurations... Click on app under Android Application, and in General Tab, find the heading 'Before Launch' Click the + button, select Run external tool, click the + button in the popup window. Give some name (Eg adb uninstall) and description, and type adb in Program: and uninstall <your-package-name> in Parameters:. Make sure that the new item is selected when you click Ok in the popup window. Note: If you do not have adb in your PATH environment variable, give the full path to adb in Program: field (eg /home/user/android/sdk/platform-tools/adb). example adb uninstall com.my.firstapp List the packages by: adb shell su 0 pm list packages Review which package you w...

Android Studio Where Is Color Picker For Flutter Plugin

Image
Answer : The color picker is not clickable in Android Studio running Flutter( Dart code), see picture below. But i found a work around using the Color class and manually opening color picker. Then pick a color and copy/paste it like this: Here is how i do it: 1. Double tap shift to run search 2. Type Color or Picker 3. Open Color Picker from the search list 4. Copy/paste the HEX color code into your color class. Expert tip: Add color picker to a keyboard shortcut . You can find the settings for Keymap , under File > Settings > Keymap

Code Iris Plugin On Android Studio

Image
Answer : Complete Guidance of CODE IRIS Graph Creation:- You have to generate Code Iris by just right clicking on project, and then select "Create Code Iris Graph" , (Check the snapshot below) Now your graph will be created, you can get the graph on the right side of Android studio (Check the below snapshot) You may access it via the vertical panel at the right of your screen in Android Studio.

Android Studio With Java Compiler Error: String Too Large To Encode Using UTF-8 Written Instead As 'STRING_TOO_LARGE'

Answer : I had encountered the same and fixed by clear the build cache . For the time being, you can downgrade Gradle version to resolve this issue. Use gradle 3.1 version like 3.1.3 below. classpath 'com.android.tools.build:gradle:3.1.3' I was stuck on this problem and read through this topic and no one provided a future solution. I did NOT want to revert back my Gradle. Therefore, here is the link to the updated dependencies https://github.com/stripe/stripe-android. Look for the "Android Studio (or Gradle)" section and you should see this "implementation 'com.stripe:stripe-android:8.1.0'" also you might need to add "-keep class com.stripe.android.** { *; }" if you are enabling minification in your build.gradle file. Overall Stripe has stopped updating their own "Stripe docs" which can be found here. To give them credit their docs are helpful and should be read at least once, but be mindful that most of the docs are ...