Is there a Rust build for aarch64-linux-android? - android

Recently I got a new smartphone with fairly beefy specs, so wanting to play around with Rust on the go I installed Termux and tried to rustup-init. However, this fails:
info: syncing channel updates for 'stable-aarch64-linux-android'
info: latest update on 2017-08-31, rust version 1.20.0 (f3d6973f4 2017-08-27)
error: target not found: 'aarch64-linux-android'
Is there another way to get a Rust environment on android?

Sadly rustup won't work on android.
You can manage to install cargo and rustc using Termux "its-pointless (live_the_dream)" community repository.
Also if you have rustup already installed, rm .cargo will remove the stub (which otherwise interferes with calling cargo or rustc).

There is a rust package available via pkg install rust. It contains Cargo and appears to install packages successfully.
The package source is here: https://github.com/termux/termux-packages/tree/master/packages/rust
Just a note: I had a binary failing to build during installation via Cargo due to libsqlite3-sys intermediate. This was solved by installing binutils package, which adds the archiver (ar) aarch64-linux-android-ar.

Related

How do I build a TWA using #bubblewrap?

I am trying to build my TWA from a PWA, and I am running into an issue after running npx #bubblewrap/cli build:
Installing Android Build Tools. Please, read and accept the license agreement
build Installing Build Tools
Warning: Unknown argument --install
The licenses have all been accepted:
$ ./sdkmanager --licenses
Warning: File /home/user/.android/repositories.cfg could not be loaded.
All SDK package licenses accepted.
done
The sdkmanager I have on my local machine comes with everything installed out-of-the-box, which is why the install command cannot be found. You can only uninstall. So, I thought I could just comment out those lines of code from the local installation of #bubblewrap, but that did not stop this from executing.
Please, help! I am at a loss, and have no idea what to do! lol
I have all of the prerequesists installed. Here is my llama file:
{
"jdkPath":"/usr/lib/jvm/java-8-openjdk-amd64/jre",
"androidSdkPath":"/home/user/android"
}
This is the android-sdk I have installed: sdk-tools-linux-3859397.zip
It was just an outdated version of the SDK: https://developer.android.com/studio#command-tools
I needed to use the newest Linux distro version instead of an older one I downloaded from a command online that I thought would match Java 8 better...lol smh
It builds just fine now.
Thanks to anyone who attempted to answer!!!!
You can also generate your signed APK for your TWA on https://www.pwabuilder.com. We've been working with Google embedding their Bubblewrap tooling on our servers in a transparent way.
Read more: https://www.davrous.com/2020/02/07/publishing-your-pwa-in-the-play-store-in-a-couple-of-minutes-using-pwa-builder/
David

Upgrading Phonegap Android from 2.5 to 2.6 and 2.7 step

Hi I have problem upgrading Phonegap from 2.5.0 to 2.6.0 and 2.7.0 and specifically with step 8. I'm following the steps from the documentation Upgrading Cordova Android
Copy files from bin/templates/cordova to the cordova directory in your project
Where should I put those files, so they could upgrade my project?
The Android Phonegap conversion docs have changed significantly. There's no longer a step by step process that walks through each upgrade requirement. Instead, theres an "update" program that theoretically does the upgrade automatically. It didn't exactly work this way for me. After going through the documented update process (one step now) I had to go through my project and make sure everything was in place - specifically the cordova-2.7.0.jar and the cordova-2.7.0.js files.
I've just finished upgrading an Android project from Phonegap v2.5.0 to Phonegap v2.7.0. The process I followed was:
Back up the Android project.
Execute the Phonegap update command for v2.7.0 as described in the PG upgrade documentation
Change the current directory to Phonegap for Android directory:
$ cd /phonegap-2.7.0/lib/android
Execute the update command:
$ ./bin/update YOUR/CORDOVA/PROJECT/DIR
Ensure that Eclipse is referencing the correct Phonegap library in the libs directory: cordova-2.7.0.jar.
I also deleted the reference to the previous jar file.
Make sure that the phonegap javascript file (cordova-2.7.0.js) is referenced appropriately in the index.html file.
From within Eclipse: Project/Clean
Build the project and test.
I'm also trying to upgrade from 2.5.0 to 2.7.0 and running the update.bat file gave me the following message: Missing one of the following: JDK: java.oracle.com Android SDK: developer.android.com Apache ant: ant.apache.org – Etienne Desgagné May 27 at 2:15"
You need to check your 'path' System Variables in Environment variables under advanced system settings. JDK is the Java Development Kit and you check if it's correct by 'echo %JAVA_HOME% in a terminal. Ant is an apache thing and again you check that's correct by 'echo %ANT_HOME% and then you just need to make sure your Android SDK folder is in the path variable.

How do I update an Android project from a Jenkins job?

I am setting up Jenkins to clone my git project, update the project, then build using ant. If I perform an ls in the job after cloning the repo, I see my project.properties file present (containing target).
To update the project (and therefore generate the build.xml file) I issue the following command:
android update project -p ./
However, I get the following console output:
Error: The project either has no target set or the target is invalid.
Does anyone know how to update an android project from Jenkins and avoid this problem?
So you've eliminated the first part of the error (i.e. the project does have a target set), but not the second part.
The message "target is invalid" means that you don't have the target platform installed in the Android SDK that Jenkins is using.
e.g. if your target is android-17, then you need to install the Android 4.2 platform (for example via the command android update sdk -u -t android-17).
As an aside, you can automate both the relevant calls to android update -p and the installation of required target platforms using the Android Emulator Plugin for Jenkins.

Necessitas (Qt/Android NDK) qmake paths

I am running openSUSE 12.2 64-bit trying to compile an app in Necessitas alpha 4.1. It's a basic app and the code is likely not the issue. Through the course of tracing the issue I made sure to have all dependencies and tools.jar, which can apparently cause similar errors. When compiling I get:
Packaging Error: Command '/usr/bin/ant clean debug' failed.Exit code: 1
File not found:
No file is actually listed. I copy/pasted this line from Projects->Build Steps->qmake:
/home/mark/Software/necessitas/Android/Qt/482/armeabi-v7a/bin/qmake /home/mark/Dev/qt/myProject/myProject.pro -r -spec android-g++ CONFIG+=debug CONFIG+=declarative_debug
Then I pasted in a terminal window and the result is:
sh: /home/mark/necessitas/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: No such file or directory
This is obviously incorrect as my path is ~/Software/necessitas not ~/necessitas. I have checked through every tab of Tools->Options but see nowhere that references the incorrect folder. Any clue where this is supposed to go?
I had this exact error last night. However I noticed that the Google documentation specifically said java-6-openjdk. So I installed the older JDK using synaptic and then ran:
sudo update-alternatives --config java
I selected the version 6 and re-ran the process. Which completed successfully.
(To be fair I was using Qt 5.1 beta 1 and freshly downloaded NDK and SDK's, ant was 1.8.1 from the repositories)
Were you able to resolve your problem in the mean time ?
This has to do with the Java environment variables, more precisely with JAVA_HOME.
Did you install OpenJDK right before you tried to launch your app ?
I am not certain where OpenJDK installs in OpenSUSE, but on my ArchLinux the variable had to be set to :
JAVA_HOME=/usr/lib/jvm/java-7-openjdk
in order for QtCreator to compile the project properly.
In my case, I had Oracle's JDK installed, so right after installing OpenJDK, loging out and reloging updated my environment variables as wished.
There is also a similar post to yours:
How to build my HelloWorld Android application with Necessitas (qt port)?
And you'll find a good necessitas starter video here :
http://youtu.be/suPeZ7XC1xk

How to debug android project from git using Jenkins frontend?

I have installed Jenkins on my ubuntu 11.04 system using command "apt-get install jenkins".
I am able to executes "ant debug" command from linux command line well and completed successfully But when i am trying to debug Android project from git hub using jenkins frontend by setting build target "Invoke ant" with properties "sdk.dir=/opt/android-sdk-linux-ics". It is giving following error Console Output :
########################################################################################
Started by user anonymous
Building in workspace /var/lib/jenkins/workspace/touchanimtn
Checkout:touchanimtn / /var/lib/jenkins/workspace/touchanimtn - hudson.remoting.LocalChannel#72cd429b
Using strategy: Default
Last Built Revision: Revision 3e4b580644fad8b059fb5c13925d3d86fa402187 (origin/HEAD, origin/master)
Fetching changes from 1 remote Git repository
Fetching upstream changes from https://github.com/ssamar/touchanimtn.git
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Commencing build of Revision 3e4b580644fad8b059fb5c13925d3d86fa402187 (origin/HEAD, origin/master)
Checking out Revision 3e4b580644fad8b059fb5c13925d3d86fa402187 (origin/HEAD, origin/master)
Warning : There are multiple branch changesets here
[touchanimtn] $ ant -Dsdk.dir=/opt/android-sdk-linux-ics clean debug
Buildfile: /var/lib/jenkins/workspace/touchanimtn/build.xml
BUILD FAILED
/var/lib/jenkins/workspace/touchanimtn/build.xml:83: Cannot find /opt/android-sdk-linux-ics/tools/ant/build.xml imported from /var/lib/jenkins/workspace/touchanimtn/build.xml
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
###################################################################################
I also tried by putting "android-sdk-linux-ics" into home folder but gave same error.
Please, Give me the correct solution for this error.
Either the root of your Android SDK isn't at /opt/android-sdk-linux-ics (i.e. the tools directory should be in there, with no intermediate directories), or the SDK does exist there, but the jenkins user doesn't have permission to access it.
This is a good question that more people will face when installing Jenkins on a linux system where the android SDK was installed before.
The problem is either that the path to the android SDK is not correct (1) or insufficient permissions for the jenkins user to access the android SDK installation path (2).
1) Path: Double check the path on your ant build step for the failing jenkins project. Go to the ant build step and click advanced. There it should have sdk.dir=SOME/PATH listed in the properties field. For multiple values make sure you expand the field and use a new line per value. Also don't include the -D to your argument since Jenkins will do that for each line.
2) Permissions: Double check the permissions on the android-sdk folder listed there. Use ls -l to get a list of current permissions and chmod to update the permissions if needed.
Notes:
It's always a good idea to switch to the jenkins user on your system and test the failing commands from the shell yourself.
sudo su jenkins
I had this kind of error also when I enabled security on my jenkins configuration. You can disable security without loosing settings by stopping the jenkins service, renaming the config file and restarting the service.
sudo service jenkins stop
sudo mv /var/lib/config.xml /var/lib/config.xml.backup
sudo service jenkins start
I didn't check in depth what user should get permissions in that case but I know reverting this change fixed the issue. Also I could still execute the ant scripts with the jenkins user as listed before.
This questions is very similar: Building android project from jenkins under linux - build fails, cannot find imported build.xml
Might help someone.
Wherever ANDROID_HOME/platforms pointing to
Reach in finder
bring get info
add Jenkins user and
give read access.
This solved my problem of build.xml not found error.

Categories

Resources