Please Re-import the Gradle Project and Try Again Kotlin Koans
This page tracks known issues with stable releases of Android Studio Bumblebee (2021.1.one) and Android Gradle plugin vii.one. If you lot feel an outcome not already included here, please report a bug.
Upgrade to preview: Each release of Android Studio and the Android Gradle plugin aims to improve stability and performance, and add new features. To experience the benefits of upcoming releases now, download and install Android Studio Preview.
Known Issues with Android Studio
This section describes known bug that be in the latest stable version of Android Studio.
Mistake when using different passwords for key and keystore
Starting with version 4.2, Android Studio now runs on JDK xi. This update causes an underlying behavior alter related to signing keys.
When you navigate to Build > Generate Signed Package / APK and endeavor to configure app signing for an app bundle or an APK, entering unlike passwords for the cardinal and keystore may result in the following error:
Key was created with errors: Alarm: Different store and Central passwords not supported for PKCS12 Key stores
To work around this issue, enter the same password for both the key and keystore.
Android Studio doesn't first after installing version 4.2
Studio tries to import previous .vmoptions and sanitize them to work with the garbage collector used by JDK eleven. If that process fails, the IDE may not beginning for certain users who fix custom VM options in the .vmoptions file.
To work effectually this issue, we recommend commenting out custom options in .vmoptions (using the "#" grapheme). The .vmoptions file can be found in the following locations:
Windows
C:\Users\YourUserName\AppData\[Local|Roaming]\Google\AndroidStudio4.2\studio64.exe.vmoptions
macOS
~/Library/Application Support/Google/AndroidStudio4.2/studio.vmoptions
Linux
~/.config/Google/AndroidStudio4.2/studio64.vmoptions
If Studio notwithstanding doesn't start after trying this workaround, see Studio doesn't offset after upgrade beneath.
Apps using Database Inspector crash on Android 11 emulator
Apps using the Database Inspector may crash when running on the Android xi emulator, with an mistake similar the following appearing in logcat:
Fatal indicate 11 (SIGSEGV), code 1 (SEGV_MAPERR)
To ready this outcome, upgrade your Android 11 emulator to version ix or higher by navigating to Tools > SDK Manager. In the SDK Platforms tab, check the box labeled Prove Package Details and select revision 9 or college of the Android 11 emulator.
Studio doesn't start afterwards upgrade
If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin. As a workaround, endeavor deleting (or renaming, for backup purposes) the directory beneath, depending on the Android Studio version and operating system, and get-go Android Studio again. This will reset Android Studio to its default state, with all third-party plugins removed.
For Android Studio iv.one and later:
-
Windows:
%APPDATA%\Google\AndroidStudio<version>
Example:C:\Users\your_user_name\AppData\Roaming\Google\AndroidStudio4.1
-
macOS:
~/Library/Application Support/Google/AndroidStudio<version>
Instance:~/Library/Application Support/Google/AndroidStudio4.1
-
Linux:
~/.config/Google/AndroidStudio<version>
and~/.local/share/Google/AndroidStudio<version>
Example:~/.config/Google/AndroidStudio4.i
and~/.local/share/Google/AndroidStudio4.1
For Android Studio 4.0 and before:
-
Windows:
%HOMEPATH%\.AndroidStudio<version>\config
Instance:C:\Users\your_user_name\.AndroidStudio3.6\config
-
macOS:
~/Library/Preferences/AndroidStudio<version>
Instance:~/Library/Preferences/AndroidStudio3.6
-
Linux:
~/.AndroidStudio<version>/config
Example:~/.AndroidStudio3.6/config
Note that the configuration directory for Canary and Beta releases of Android Studio is PreviewX.Y
instead of X.Y
for the <version>
. For example, Android Studio 4.one Canary builds utilise AndroidStudioPreview4.1
, instead of the AndroidStudio4.1
directory that is used for Release Candidates and Stable releases.
Compilation issue in Kotlin multiplatform projects
Compilation errors may arise in Kotlin MPP code due to missing symbols. Upgrading your Kotlin plugin to version one.4 should resolve this outcome.
Key mapping conflicts on Linux
On Linux, certain keyboard shortcuts conflict with default Linux keyboard shortcuts and those of pop window managers, such as KDE and GNOME. These conflicting keyboard shortcuts may not piece of work as expected in Android Studio.
More information most this outcome (including potential workarounds) can exist plant in IntelliJ'southward bug tracker.
Small UI text on Chrome OS
On Chrome OS, text might announced much smaller than in previous releases. To piece of work around this outcome, do the following:
- Open up the Settings window by clicking File > Settings
- Navigate to Advent & Behavior > Appearance.
- Select Employ custom font.
- Increase the font size.
- In the Settings window, navigate to Editor > Font.
- Increase the font size.
- Click OK.
Code editing
This department describes known issues related to the lawmaking editor.
Frozen keyboard input - "iBus" problems on Linux
At that place are some known interactions between the iBus daemon on Linux and Android Studio. In some scenarios, the IDE stops responding to keyboard input or starts inputting random characters. This issues is triggered by some missing synchronization betwixt iBus and XLib + AWT, and has already been reported upstream to JetBrains and iBus. There are three current workarounds for this issue:
- Workaround one: Forcefulness iBus into synchronous mode. Before starting Android Studio, run the following on the control line:
$ IBUS_ENABLE_SYNC_MODE=one ibus-daemon -xrd
- Workaround 2: Disable iBus input in Android Studio. To disable iBus input for Android Studio just, run the following on the control line:
$ XMODIFIERS= ./bin/studio.sh
This workaround but disables input methods for Android Studio, not whatsoever other applications you lot may exist running. Note that if y'all restart the daemon while Android Studio is running (for example, by runningibus-daemon -rd
), yous effectively disable the input methods for all other applications and may also crash Android Studio'south JVM with a partition fault. - Workaround three: Double-check the shortcut bindings to make sure that the Adjacent input shortcut is not prepare to Command+Infinite, since this is also the code completion shortcut in Android Studio. Ubuntu fourteen.04 (Trusty) makes Super+Space the default shortcut, simply settings from previous versions may still be around. To check your shortcut bindings, run
ibus-setup
on the control line to open the IBus Preferences window. Under Keyboard Shortcuts, check the Side by side input method. If it is prepare to Control+Infinite, change information technology to Super+Space, or another shortcut of your choice.
Project configuration
This section describes known issues related to projection configuration and Gradle sync.
Gradle Sync Failed: Broken Piping
The event is that the Gradle daemon is trying to utilize IPv4 instead of IPv6.
- Workaround 1: On Linux, put the post-obit in your
~/.contour
or~/.bash_profile
:export _JAVA_OPTIONS="-Djava.net.preferIPv6Addresses=true"
- Workaround 2: in Android Studio's vmoptions file, change the line
-Djava.net.preferIPv4Addresses=truthful
to-Djava.net.preferIPv6Addresses=truthful
For more information, encounter the Networking IPv6 User Guide.
"peer non authenticated" errors from Gradle sync or SDK Manager
The root cause of these errors is a missing certificate in $JAVA_HOME/jre/lib/certificates/cacerts
. To resolve these errors, keep as follows:
- If you lot're behind a proxy, try to connect directly. If the straight connection works, then in order to connect via the proxy you may demand to use
keytool
to add the proxy server's certificate to the cacerts file. - Re-install a supported, unmodified JDK. There's a known issue affecting Ubuntu users, which results in an empty
/etc/ssl/certs/java/cacerts
. To work around this issue, execute the post-obit on the control line:sudo /var/lib/dpkg/info/ca-certificates-coffee.postinst configure
Deploying
This section describes known issues related to deploying your app to a connected device.
[Mac Bone only] Incremental updates are not applied due to an outcome with Gradle file watching on projects saved under /System/Volumes/Data
Gradle issue 18149 affects Android Gradle Plugin versions 7.0 and higher because they require Gradle version vii.0 and higher. Starting in Gradle 7.0, file watching is enabled past default. If you are working on Mac OS and your project is saved nether /System/Volumes/Data
, Gradle file watching will not properly track file changes. This will cause the Build System to non meet any file changes and information technology will therefore not update the APK(south). The incremental deployment code volition then do nix because the local APK country is the same equally on the device.
To work around this issue yous should motion your project'south directory to your user directory, that is, under /Users/username
. The Build Organization will then be properly notified about file changes past Gradle file watching and incremental changes will be successfully applied.
Android Emulator HAXM on macOS Loftier Sierra
The Android Emulator on macOS High Sierra (ten.13) requires HAXM 6.2.ane+ for all-time compatibility and stability with macOS. However, macOS 10.13 has a more involved process to install kernel extensions such every bit HAXM. You need to manually allow the kernel extension itself to be installed as follows:
- First, attempt to install the latest version of HAXM from the SDK Manager.
- In MacOS, go to Organization Preferences > Security and Privacy.
-
If you meet an warning that System software from developer "Intel Corporation Apps" was blocked from loading, click Allow:
For more information and workarounds, see this Apple webpage and consequence 62395878.
Apply Changes
This department describes known issues that are related to Apply Changes.
New app name non practical
If you rename your app and then try to utilise that change, the updated name might not be reflected. To work effectually this issue, click Run to re-deploy your app and see your changes.
Consequence in Android Runtime throws error
If you're using a device that runs Android eight.0 or 8.1, you might meet "VERIFICATION_ERROR" messages when trying to apply certain types of changes (especially if you're using Kotlin). This bulletin is acquired by an issue with the Android Runtime that is fixed in Android 9.0 and higher. Although the consequence causes Apply Changes to neglect, you can still Run your app again to encounter your changes. However, we recommend that you upgrade the device to Android 9.0 or greater.
Debugging and testing
This department describes known problems related to debugging and testing your app.
JUnit tests missing resource in classpath when run from Android Studio
If yous accept specific resource folders in your Coffee modules, so those resources won't be found when running tests from the IDE. Running tests using Gradle from the command line will work. Executing the Gradle check
chore from the IDE volition as well work. See upshot 64887 for more details.
This upshot occurs because as of IntelliJ thirteen, which requires that you lot only accept a single folder as the classpath. IntelliJ's builder copies all resources into that build folder, but Gradle doesn't re-create over the resources.
- Workaround 1: Run the Gradle
check
task from the IDE rather than running a unit exam. - Workaround two: Update your build script to manually copy resources into the build folder. See comment #thirteen for more information.
Running JUnit tests may compile the lawmaking twice
When creating a new project, the template JUnit configuration might be created with 2 "Before launch" steps: Brand and Gradle-aware Brand. This configuration is and so propagated to all created JUnit run configurations.
- To set up the issue for the current project, click Run > Edit Configurations and change the default JUnit configuration to only include the Gradle-aware Make step.
- To fix the issue for all hereafter projects, click File > Close Project. You should see the welcome screen. Then click Configure > Projection Defaults > Run Configurations and alter the JUnit configuration to only include the Gradle-aware Make step.
Some examination run configurations don't work
Not all run configurations that are available when correct-clicking a exam method are valid. Specifically, the following configurations are not valid:
- Gradle run configurations (which accept a Gradle logo equally the icon) don't work.
- JUnit run configurations (which have an icon without the green Android) don't utilize to instrumentation tests, which cannot be run on the local JVM.
Android Studio also remembers the run configuration created in a given context (for example, right-clicking a specific class or method), and will non offering to run in a dissimilar configuration in the future. To fix this, click Run > Edit Configurations and remove the incorrectly-created configurations.
Adding Java breakpoints while debugging native code
While your app is paused at a breakpoint in your native code, the Motorcar and Dual debuggers may not immediately recognize new Java breakpoints that you lot set. To avoid this issue, add Coffee breakpoints either before starting a debug session or while the app is paused on a Java breakpoint. For more information, run across effect 229949.
Stepping out of the native debugger
While using the Auto or Dual debugger to debug Java and native lawmaking, if you lot step into a native role from your Java code (for example, the debugger pauses execution at a line in your Java code that calls a native part and yous click Stride Into ) and you desire to render to your Java lawmaking, click Resume Programme (instead of Footstep Out or Pace Over ). Your app process will still be paused, then click Resume Program in the your-module-java tab to resume information technology. For more information, see consequence 224385.
Native debugger hangs while loading libraries
While using the native debugger for the commencement fourth dimension after upgrading to Android Studio 4.ii and higher, the native debugger may stop responding while loading libraries from the Android device. This issue is a sticky problem that continues to happen even if you stop and restart the debugger. To set this problem, delete the LLDB cache at $USER/.lldb/module-cache/
.
Native debugger crashes with "Debugger procedure finished with exit lawmaking 127"
This mistake occurs on Linux-based platforms when starting the native debugger. It indicates that one of the libraries required past the native debugger is not installed on the local arrangement. The name of the missing library may exist already printed in the idea.log
file. If not, you can use a final to navigate to the Android Studio installation directory and execute the bin/lldb/bin/LLDBFrontend --version
command line to learn which libraries are missing. Typically, the missing library is ncurses5
equally some recent Linux distributions have already upgraded to ncurses6
.
Profilers
This department describes known issues with the Profilers.
Native Memory Profiler: Profiling not available during app startup
The Native Memory Profiler is currently unavailable during app startup. This option will be available in an upcoming release.
As a workaround, y'all tin use the Perfetto standalone command-line profiler to capture startup profiles.
Timeout errors in CPU Profiler
You may feel "Recording failed to finish" errors in the Android Studio CPU Profiler when you lot select the Sample Java Methods or Trace Java Methods configurations. These are often timeout errors, peculiarly if you lot see the following mistake message in the idea.log
file:
Expect for ART trace file timed out
The timeout errors tend to affect traced methods more than sampled methods and longer recordings more than shorter recordings. Equally a temporary workaround, it may exist helpful to try shorter recordings to see if the error disappears.
If you experience timeout bug with the Profiler, delight file a issues that includes the brand/model of your device(due south) and whatever relevant entries from idea.log
and logcat.
ADB exception when debugging or profiling
When using Platform Tools 29.0.3, native debugging and the Android Studio Profilers might not work properly, and you might see either "AdbCommandRejectedException" or "Failed to connect port" in the idea.log
file when you select Assist > Show Log. Upgrading the Platform Tools to 29.0.4 or higher fixes both bug.
To upgrade the Platform Tools, do the post-obit:
- Open the SDK Manager from Android Studio by clicking Tools > SDK Director or click SDK Director in the toolbar.
- Click the checkbox next to Android SDK Platform-Tools and so it shows a checkmark. A download icon should appear in the left column.
- Click Apply or OK.
Plugin prevents Build Output window from working {:#cmake-highlighter)
Using the CMake simple highlighter plugin prevents content from actualization in the Build Output window. The build runs and the Build Output tab appears, but there is no output printed (issue #204791544).
Known problems with the Android Gradle Plugin
This section describes known bug that exist in the latest stable version of the Android Gradle plugin.
Not all dynamic-characteristic library dependencies are lint checked
When running lint with checkDependencies = true
from an app module, dynamic-feature library dependencies aren't checked unless they're as well app dependencies (issue #191977888). Equally a workaround, the lint job tin be run on those libraries.
Signing file named with railroad vehicle return characters
JAR signing (v1 scheme) does not support file names containing wagon return characters (issue #63885809).
API changes
Android Gradle Plugin iii.0.0 and higher introduce API changes that remove certain functionalities and may break your existing builds. Later on versions of the plugin may innovate new public APIs that replace broken functionalities.
Modifying variant outputs at build fourth dimension may not work
Using the Variant API to dispense variant outputs is broken with the new plugin. Information technology still works for simple tasks, such as changing the APK name during build time, equally shown below:
// If you apply each() to iterate through the variant objects, // yous need to kickoff using all(). That'south because each() iterates // through only the objects that already exist during configuration time— // just those object don't exist at configuration time with the new model. // However, all() adapts to the new model past picking up object as they are // added during execution. android.applicationVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.name}-${variant.versionName}.apk" } }
Notwithstanding, more than complicated tasks that involve accessing outputFile
objects no longer work. That'southward because variant-specific tasks are no longer created during the configuration phase. This results in the plugin not knowing all of its outputs up front, but it as well ways faster configuration times.
manifestOutputFile is no longer available
The processManifest.manifestOutputFile()
method is no longer bachelor, and you become the following fault when you call information technology:
A trouble occurred configuring projection ':myapp'. Could not get unknown property 'manifestOutputFile' for task ':myapp:processDebugManifest' of type com.android.build.gradle.tasks.ProcessManifest.
Instead of calling manifestOutputFile()
to get the manifest file for each variant, you tin can call processManifest.manifestOutputDirectory()
to return the path of the directory that contains all generated manifests. You can then locate a manifest and employ your logic to it. The sample below dynamically changes the version code in the manifest:
android.applicationVariants.all { variant -> variant.outputs.all { output -> output.processManifest.doLast { // Stores the path to the maifest. String manifestPath = "$manifestOutputDirectory/AndroidManifest.xml" // Stores the contents of the manifest. def manifestContent = file(manifestPath).getText() // Changes the version code in the stored text. manifestContent = manifestContent.replace('android:versionCode="i"', String.format('android:versionCode="%s"', generatedCode)) // Overwrites the manifest with the new text. file(manifestPath).write(manifestContent) } } }
Fixed known issues
This section describes known bug that have been stock-still in a recent release. If y'all are experiencing any of these issues, you should update Android Studio to the latest stable or preview version.
Fixed in Android Studio 2021.i.1
- Missing lint output: There is no lint text output printed to
stdout
when the lint task isUP-TO-Appointment
(issue #191897708). Fixed in AGP 7.one.0-alpha05. - Problems with unit testing an app project that uses the Hilt plugin: The unit exam classpath contains the non-instrumented app classes, which means Hilt does not instrument the app classes to handle dependency injection when running unit of measurement tests (upshot #213534628). Fixed in AGP seven.ane.1.
Fixed in Android Studio 2020.3.1
- Lint exceptions in Kotlin projects: Kotlin projects that set
checkDependencies = truthful
may come across zilch pointer exceptions or errors (issue #158777858).
Fixed in Android Studio 4.two
- IDE freezes on macOS Big Sur: Android Studio four.1 might freeze when yous open a dialog.
Fixed in Android Studio iv.1
- Restart to apply retentiveness settings from previous version of IDE: After updating Android Studio, yous need to restart Android Studio to utilise any retention settings migrated from an earlier version of the IDE.
- Manifest class with custom permission strings is no longer generated by default: If you want to generate the course, ready
android.generateManifestClass = true
.
Stock-still in Android Studio 3.half-dozen
-
APK installation fault on LineageOS: Deploying your app to devices running sure versions of LineageOS or CyanogenMod might fail and throw an
INSTALL_PARSE_FAILED_NOT_APK
exception.On Android Studio 3.6 Beta 1 and higher, the IDE handles this exception by performing a total app install when yous deploy your app to LineageOS or CyanogenMod devices, which might consequence in longer deploy times.
Fixed in Android Studio 3.five.2
- Broken XML code way: When editing XML code, the IDE applied an incorrect code style when you lot selected Code > Reformat Code from the card bar.
Stock-still in Android Studio 3.3.1
-
Out of memory errors when scanning C++-based projects: When Gradle scans a project that has C++ code in more than one location on the aforementioned drive, the scan includes all directories below the first common directory. Scanning a big number of directories and files may lead to out of retentiveness errors.
For more information on this issue, read the bug associated with the event.
Source: https://developer.android.com/studio/known-issues
0 Response to "Please Re-import the Gradle Project and Try Again Kotlin Koans"
ارسال یک نظر