Open Benjamin-Loison opened 9 months ago
Blocked in theory by https://github.com/Benjamin-Loison/termux-app/issues/11, as I have not tested running my compiled .apk
.
I tested and my Termux API modification was correctly taken into account, at least when installing my own Termux.
With original Termux I get:
adb install termux-api_debug.apk
Performing Streamed Install
adb: failed to install termux-api_debug.apk: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Reconciliation failed...: Reconcile failed: Package com.termux.api has no signatures that match those in shared user com.termux; ignoring!]
adb install termux-api_release.apk
Performing Streamed Install
adb: failed to install termux-api_release.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl2066703661.tmp/base.apk: Failed to collect certificates from /data/app/vmdl2066703661.tmp/base.apk: Attempt to get length of null array]
ls
app build.gradle gradle gradle.properties gradlew gradlew.bat README.md settings.gradle
./gradlew build
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew build
Same issue when compile again it seems.
Note that before these compilations thanks to the Stack Overflow answer 64966 I paid attention to remove untracked files and folders, I also git stash
my few changes and git pull
. I also paid attention not to be on my fork with git remote -v
.
First let us try to compile most recent commit, then commit/e315b53ec048e3dd321d69525c9e1162ca53f19f will test and finally will proceed to bissect.
I suspect ./gradlew build
not to be the right command.
history | grep gradle | cut -d ' ' -f5- | sort | uniq
./gradlew assembleDebug
seems to return the same output.
It was looking promising as last time I executed it was in the command:
./gradlew assembleDebug && adb install ./app/build/outputs/apk/debug/termux-api_debug.apk
at 31/03/24 04:28:51.
Could investigate GitHub action and the commit at that time.
termux-api/actions/runs/10155362023/job/28081990125
blob/c553bc2ba7de37ad5c42df23d71e699d2785d7c5/.github/workflows/debug_build.yml
blob/c553bc2ba7de37ad5c42df23d71e699d2785d7c5/.github/workflows/debug_build.yml#L44 also uses ./gradlew assembleDebug
.
Based on Benjamin-Loison/termux-app/issues/11#issue-2128625534:
git diff
./gradlew assembleDebug
./gradlew assembleDebug
https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/
does not list initial 7.3.1, see blob/c553bc2ba7de37ad5c42df23d71e699d2785d7c5/build.gradle#L7
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/
does not help either.
According to https://mvnrepository.com/artifact/com.android.tools.build/gradle, the most recent version is 8.6.0.
./gradlew assembleDebug
Current working directory on my Linux Mint 22 Cinnamon Framework 13 is:
/home/benjamin/Desktop/bens_folder/dev/git/github/termux-api/
On my Fairphone 4 LineageOS Termux:
pwd && find -name termux-api
/data/data/com.termux/files/home/bens_folder
./dev/gits/original/termux/termux-packages/packages/termux-api
./dev/gits/original/termux/termux-api
pkg install java
pkg install default-jre
apt search openjdk
pkg install openjdk-17
./gradlew assembleDebug
pwd && find -name 'android-sdk'
/data/data/com.termux/files
In the past I upvote the Stack Overflow answer 34627928.
pkg install android-sdk
pkg install setup-android-ndk
termux-packages/blob/388cd7e4279e8a1e154fd3af572aa79d9d72cefa/scripts/setup-android-sdk.sh
DuckDuckGo and Google results for "SDK location not found." "Termux"
do not seem relevant.
Searching Install Android SDK within Termux may be more helpful.
termux-packages/pull/7227 (source: https://www.reddit.com/r/termux/comments/xauo68/comment/invq2id/) seems complicated.
Can try on my Debian 12 GNOME Pegasus.
pwd && find -name 'termux-api'
/home/benjamin_loison/Desktop/BensFolder/DEV
find: ‘./VM/virt-manager/linux/debian/debian_trust/shared/.Trash-1000’: Permission denied
./gradlew assembleDebug
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew assembleDebug
sdkmanager
Command 'sdkmanager' not found, but can be installed with:
sudo apt install sdkmanager
sdkmanager.bat
sdkmanager.bat: command not found
pwd && find -name 'sdkmanager*'
/usr/lib/android-sdk
tree /usr/lib/android-sdk
/usr/lib/android-sdk
└── platform-tools
├── adb
├── package.xml
└── source.properties
2 directories, 3 files
sudo apt install -y sdkmanager
Same output as above.
sdkmanager --licenses
Source: the Stack Overflow answer 55641042
sudo sdkmanager --licenses
sudo apt purge -y sdkmanager
ls /usr/lib/android-sdk/licenses
ls: cannot access '/usr/lib/android-sdk/licenses': No such file or directory
android-sdk/licenses
is not mentioned in the Stack Overflow question 54273412 its answers and their first comments.
sudo touch /usr/lib/android-sdk/licenses
and
sudo mkdir /usr/lib/android-sdk/licenses/
do not help.
DuckDuckGo and Google results for "Warning: License for package Android Emulator not accepted."
do not seem to help much.
time sudo find / -name 'sdkmanager*' 2> /dev/null
/root/.cache/sdkmanager
/home/benjamin_loison/.cache/sdkmanager
real 2m14.059s
user 0m0.006s
sys 0m0.006s
ls ~/.cache/sdkmanager/
checksums.json checksums.json.asc checksums.json.etag keyring.gpg
maybe it is related to APT sdkmanager
.
https://developer.android.com/studio/intro/update.html#download-with-gradle
On my Linux Mint 22 Cinnamon Framework 13:
ls -lh /usr/lib/android-sdk/licenses
total 8.0K
-rw-r--r-- 1 benjamin benjamin 123 Dec 7 2023 android-sdk-license
-rw-r--r-- 1 root root 40 Jan 24 2023 apache-2.0
android-sdk-license
:
8933bad161af4178b1185d1a37fbf41ea5269c55
d56f5187479451eabf01fb78af6dfcb131a6481e
24333f8a63b6825ea9c5514f83c2829b004d1fee
apache-2.0
:
3cc38bed50fbdebc46e7ef8f87848f2a2fbaf2cd
The aim is to use another fresh environment but I do not see a clear cleaner other workaround.
which is a bit different as above.
termux-api/blob/c553bc2ba7de37ad5c42df23d71e699d2785d7c5/.github/workflows/debug_build.yml does not seem to show how it accepts licenses.
On Debian 12 OverClock3000:
git clone git@github.com:termux/termux-api.git
./gradlew assembleDebug
tree /usr/lib/android-sdk
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew assembleDebug
Maybe should test with a fresh Debian 12 with snapshots.
sdkmanager --licenses
Command 'sdkmanager' not found, but can be installed with:
sudo apt install sdkmanager
find /usr/lib/android-sdk -name 'sdkmanager*'
On Linux Mint 22 Cinnamon Framework 13 VirtualBox Test Travian Debian 12 virtual machine with Actually fresh up to date snapshot.
git clone https://github.com/termux/termux-api
Maybe should investigate gradlew
.
./gradlew assembleDebug
ls /usr/lib/android-sdk/
ls: cannot access '/usr/lib/android-sdk/': No such file or directory
Still have the same ls
error after:
sudo apt install -y sdkmanager
sudo apt install -y android-sdk
tree /usr/lib/android-sdk/
bash: tree: command not found
sudo apt install -y tree
tree /usr/lib/android-sdk/
echo 'sdk.dir=/usr/lib/android-sdk' > local.properties
./gradlew assembleDebug
sdkmanager
bash: sdkmanager: command not found
sdkmanager.bat
bash: sdkmanager.bat: command not found
time sudo find / -name 'sdkmanager*' 2> /dev/null
real 0m1.639s
user 0m0.005s
sys 0m0.007s
DuckDuckGo and Google searching "Observed package id 'build-tools;29.0.3' in inconsistent location '/usr/lib/android-sdk/build-tools/debian' (Expected '/usr/lib/android-sdk/build-tools/29.0.3')"
.
Filling /usr/lib/android-sdk/licenses/android-sdk-license
thanks to fdroidserver/blob/143639b8df6f7725678839834d49788c93548f43/buildserver/provision-android-sdk#L122-L129 based on https://forum.f-droid.org/t/failed-to-install-the-following-android-sdk-packages-as-some-licences-have-not-been-accepted/12884/2:
./gradlew assembleDebug
sudo ./gradlew assembleDebug
So coming back to Linux Mint 22 Cinnamon Framework 13 with fresh repository:
./gradlew assembleDebug
looks like another reason to move from Linux Mint 22 Cinnamon to Debian 12 GNOME.
DuckDuckGo search "Caused by: [CIRCULAR REFERENCE: java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null]"
.
./gradlew assembleDebug
settings.gradle
:AGP seems to stand for Android Gradle Plugin, according to flutter/issues/145789#issuecomment-2021570252.
Hence maybe modifying Gradle version may help.
git diff
Source: https://issuetracker.google.com/issues/342522142#comment8
./gradlew assembleDebug
git diff gradle/wrapper/gradle-wrapper.properties
On Debian 12 GNOME Pegasus:
./gradlew assembleDebug
Modifying /usr/lib/android-sdk/licenses/android-sdk-license
as above:
./gradlew assembleDebug
./gradlew assembleDebug
still a mistery why does not work on Linux Mint 22 Cinnamon Framework 13.
Related to Benjamin_Loison/termux-gui/issues/2.
termux-api termux-app/blob/8e3a8980a849046adbd4156741e1d84047ee1df6/README.md#installation termux-api/blob/4159c62dd6cd9a8793465def769686fc7ac99fe2/README.md?plain=1#L8-L10
Feature description
Reference implementation
Have you checked if the feature is accessible through the Android API? Do you know of other open-source apps that has a similar feature as the one you want? (Provide links)