Search code examples
android-studiodeveloper-tools

Unable to load class net.rubygrapefruit.platform.NativeIntegrationUnavailableException


I just installed Android Studio, created my first project and got this message: "Unable to load class net.rubygrapefruit.platform.NativeIntegrationUnavailableException".

I asked my tutor for help, he said I don't have Java installed, but I have it installed: my Kotlin projects compile. The version of the SDK I have is 33. Can you please tell me how to solve this problem?


Solution

  • For anyone who still has this problem after restarting Android Studio, or after clearing the Android Studio cache, here is a definite fix.

    This error does sometimes seem to pop up when there is a SDK update in Android Studio. To fix this, go to the gradle-wrapper.properties file, and update the distributionUrl as such:

    1. Go to the following URL: https://services.gradle.org/distributions/
    2. Check the latest version of the gradle distributable. Look at the top most files for the latest version number. At the time of writing this answer, 8.6 is the latest version.
    3. Go back to your gradle-wrapper.properties file and edit the distributionUrl by replacing the existing version with the latest version that you found in step 2. Here is an example:

    Old version: distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip Replace with: distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip

    1. Sync gradle after doing the changes. Your IDE should prompt you automatically to do so.