I'm stuck with making AndroidSDK load the right path. It should load the path /Users/ansible-pipeline/Library/Android/sdk
instead of /opt/homebrew/Caskroom/android-sdk/4333796
. I've search the web, read the documentation but couldn't find a way. Any thoughts on how to fix this?
context
I'm simply using cdxgen
to create a sbom file.
with the following command.
cdxgen -t kotlin -o android-bom.json --deep
Then it spits the following error.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':iscsdk'.
> java.lang.IllegalStateException: DefaultSdkLoader already created using /opt/homebrew/Caskroom/android-sdk/4333796; cannot also use /Users/ansible-pipeline/Library/Android/sdk. If this is a Gradle composite build, it could be that you have set "sdk.dir" to multiple values across builds. Make sure that "sdk.dir" is the same in all .properties files of the composite build
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@7b52280b of type BuildFlowService.Parameters
> A problem occurred configuring project ':iscsdk'.
> java.lang.IllegalStateException: DefaultSdkLoader already created using /opt/homebrew/Caskroom/android-sdk/4333796; cannot also use /Users/ansible-pipeline/Library/Android/sdk. If this is a Gradle composite build, it could be that you have set "sdk.dir" to multiple values across builds. Make sure that "sdk.dir" is the same in all .properties files of the composite build
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .
==============================================================================
BUILD FAILED in 488ms
1. Check if the correct version of java and gradle are installed and available in PATH. For example, some project might require Java 11 with gradle 7.
cdxgen container image bundles Java 23 with gradle 8 which might be incompatible.
2. Try running cdxgen with the custom JDK11-based image `ghcr.io/cyclonedx/cdxgen-java11:v11`.
Executing gradle --build-cache --console plain --no-parallel dependencies in .
No packages found. Set the environment variable 'CDXGEN_DEBUG_MODE=debug' to troubleshoot any gradle related errors.
About to identify class names for all jars in the path /Users/ansible-pipeline/.gradle/caches/modules-2/files-2.1
It complains saying the DefaultSdkLoader
is already created using the wrong path value. Here the wrong path value comes from when I used homebrew
to install AndroidSDK which now is uninstalled in order to use Android Studio and/or sdkmanager to do the job, install AndroidSDK. The command I used is as following.
./sdkmanager "platform-tools" "platforms;android-34" --sdk_root=/Users/ansible-pipeline/Library/Android/sdk
As I run the command
cdxgen -t kotlin -o android-bom.json --deep
again, the above error happens.
Here's some info that might be useful.
the wrong path(/opt/homebrew/Caskroom/android-sdk/4333796) doesn't exist anymore.
set Android SDK Location from Android Studio: /Users/ansible-pipeline/Library/Android/sdk
I'm stuck with making AndroidSDK load the right path. It should load the path /Users/ansible-pipeline/Library/Android/sdk
instead of /opt/homebrew/Caskroom/android-sdk/4333796
. I've search the web, read the documentation but couldn't find a way. Any thoughts on how to fix this?
context
I'm simply using cdxgen
to create a sbom file.
with the following command.
cdxgen -t kotlin -o android-bom.json --deep
Then it spits the following error.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':iscsdk'.
> java.lang.IllegalStateException: DefaultSdkLoader already created using /opt/homebrew/Caskroom/android-sdk/4333796; cannot also use /Users/ansible-pipeline/Library/Android/sdk. If this is a Gradle composite build, it could be that you have set "sdk.dir" to multiple values across builds. Make sure that "sdk.dir" is the same in all .properties files of the composite build
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Failed to query the value of property 'buildFlowServiceProperty'.
> Could not isolate value org.jetbrains.kotlin.gradle.plugin.statistics.BuildFlowService$Parameters_Decorated@7b52280b of type BuildFlowService.Parameters
> A problem occurred configuring project ':iscsdk'.
> java.lang.IllegalStateException: DefaultSdkLoader already created using /opt/homebrew/Caskroom/android-sdk/4333796; cannot also use /Users/ansible-pipeline/Library/Android/sdk. If this is a Gradle composite build, it could be that you have set "sdk.dir" to multiple values across builds. Make sure that "sdk.dir" is the same in all .properties files of the composite build
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
==============================================================================
BUILD FAILED in 488ms
1. Check if the correct version of java and gradle are installed and available in PATH. For example, some project might require Java 11 with gradle 7.
cdxgen container image bundles Java 23 with gradle 8 which might be incompatible.
2. Try running cdxgen with the custom JDK11-based image `ghcr.io/cyclonedx/cdxgen-java11:v11`.
Executing gradle --build-cache --console plain --no-parallel dependencies in .
No packages found. Set the environment variable 'CDXGEN_DEBUG_MODE=debug' to troubleshoot any gradle related errors.
About to identify class names for all jars in the path /Users/ansible-pipeline/.gradle/caches/modules-2/files-2.1
It complains saying the DefaultSdkLoader
is already created using the wrong path value. Here the wrong path value comes from when I used homebrew
to install AndroidSDK which now is uninstalled in order to use Android Studio and/or sdkmanager to do the job, install AndroidSDK. The command I used is as following.
./sdkmanager "platform-tools" "platforms;android-34" --sdk_root=/Users/ansible-pipeline/Library/Android/sdk
As I run the command
cdxgen -t kotlin -o android-bom.json --deep
again, the above error happens.
Here's some info that might be useful.
the wrong path(/opt/homebrew/Caskroom/android-sdk/4333796) doesn't exist anymore.
set Android SDK Location from Android Studio: /Users/ansible-pipeline/Library/Android/sdk
1 Answer
Reset to default 0I couldn't change the SDK path because it was set correctly.
AndroidSDK was loading the wrong path value because it was loading the value from ~/.android/cache/
directory.
The job works fine after deleting cache files.