Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageMobile
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Paul Calderone
PrivateStorageMobile
Commits
41eeaa02
Commit
41eeaa02
authored
2 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
try harder to tell gradle et al where to find the tools
it doesn't work though
parent
d3b62cad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flake.nix
+49
-9
49 additions, 9 deletions
flake.nix
with
49 additions
and
9 deletions
flake.nix
+
49
−
9
View file @
41eeaa02
...
...
@@ -128,22 +128,62 @@
ANDROIDSDK
=
"
${
androidComposition
.
androidsdk
}
/libexec/android-sdk"
;
ANDROIDNDK
=
"
${
ANDROIDSDK
}
/ndk-bundle"
;
buildInputs
=
with
pkgs
;
[
# XXXX
# gradle finds an aapk2 from some random tgz it downloads from internet instead of from our ANDROIDSDK! GREAT!!!!!!!!!!11111
#
# Fix the one it downloads, if it didn't already root you, with:
#
# patchelf --set-interpreter <correct ld.so> ~/.gradle/<...path to aapt2>
ANDROID_SDK_ROOT
=
ANDROIDSDK
;
ANDROID_NDK_ROOT
=
ANDROIDNDK
;
# Deprecated but ... :shrug:
ANDROID_HOME
=
ANDROIDSDK
;
# Make sure gradle uses the aapt2 from our Android SDK. Otherwise it
# downloads one from the internet that doesn't work because it
# specifies an interpreter (ld.so) that nothing has ensures will
# exist.
#
# Without this you get a stack of build errors that look a bit like:
#
# Execution failed for task ':app:processDebugResources'. #
# > Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
# > Failed to transform appcompat-1.3.0.aar (androidx.appcompat:appcompat:1.3.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
# > Execution failed for AarResourcesCompilerTransform: /home/exarkun/.gradle/caches/transforms-3/f5908003b5fc10a9cf0fd543db10ae32/transformed/appcompat-1.3.0.
# > AAPT2 aapt2-7.2.1-7984345-linux Daemon #1: Daemon startup failed
# This should not happen under normal circumstances, please file an issue if it does.
# GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${ANDROIDSDK}/build-tools/${buildToolsVersion}/aapt2";
buildInputs
=
with
pkgs
;
[
gradle
ant
# openjdk8
android-studio
android-tools
python39
];
shellHook
=
''
# Tell the tools a third time where the SDK and NDK are to be found.
cat >app/local.properties <<EOF
# THIS FILE IS AUTOMATICALLY GENERATED
# DO NOT EDIT
# YOUR CHANGES WILL BE DESTROYED
sdk.dir=
${
ANDROIDSDK
}
# This probably needs to be set somewhere, but perhaps not here?
#
# > [CXX5106] NDK was located by using ndk.dir property. This method
# > is deprecated and will be removed in a future release. Please delete
# > ndk.dir from local.properties and set android.ndkVersion to
# > [23.0.7123448] in all native modules in the project.
# > https://developer.android.com/r/studio-ui/ndk-dir
# android.ndkVersion=
${
ndkVersion
}
EOF
''
;
# cat >app/app/gradle.properties <<EOF
# # THIS FILE IS AUTOMATICALLY GENERATED
# # DO NOT EDIT
# # YOUR CHANGES WILL BE DESTROYED
# android.aapt2FromMavenOverride=${ANDROIDSDK}/build-tools/30.0.3/aapt2
# EOF
};
devShells
.
default
=
self
.
devShells
.
${
system
}
.
gradle
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment