Flutter: Difference between revisions

m Fix typo androidsdk -> androidSdk
Bme (talk | contribs)
Clarifying the troubleshooting section: deleting the cached file is only important if shell changes aren't reflected in the build.
Line 111: Line 111:
== Troubleshooting ==
== Troubleshooting ==


* The default Gradle template for android captures the Android and Flutter SDK paths in <code>android/local.properties</code> preventing future updates to the SDK from participating in the build. This manifests itself as Gradle failing to install SDK components registered in the shell. To fix, simply delete the properties file and run the build again.<syntaxhighlight lang="shell-session">FAILURE: Build failed with an exception.
* The default Gradle template for android captures the Android and Flutter SDK paths in <code>android/local.properties</code> preventing future updates to the SDK from participating in the build. This manifests itself as Gradle failing to install SDK components registered in the shell. To fix, simply delete the properties file and run the build again. NOTE: this assumes that the shell correctly reflects the requirements of the build. If it doesn't correct that first, otherwise deleting <code>android/local.properties</code> achieves nothing.<syntaxhighlight lang="shell-session">FAILURE: Build failed with an exception.


* Where:
* Where:
Line 120: Line 120:
> com.android.builder.sdk.InstallFailedException: Failed to install the following SDK components:
> com.android.builder.sdk.InstallFailedException: Failed to install the following SDK components:
       ndk;26.3.11579264 NDK (Side by side) 26.3.11579264
       ndk;26.3.11579264 NDK (Side by side) 26.3.11579264
   The SDK directory is not writable (/nix/store/1xw5npxd7isrl50pl7y82anhdapnfs6p-androidsdk/libexec/android-sdk)</syntaxhighlight>Alternatively, adjust <code>composeAndroidPackages</code> to include the exact version of the SDK components flutter requires. In the example above, simply add the <code>ndkVersion</code> as in the example below.
   The SDK directory is not writable (/nix/store/1xw5npxd7isrl50pl7y82anhdapnfs6p-androidsdk/libexec/android-sdk)</syntaxhighlight>
{{Code|1=...
      androidComposition = pkgs.androidenv.composeAndroidPackages {
        ...
        ndkVersions = [ "26.3.11579264" ]
        ...
      };
...}}
 
== See also ==
== See also ==