Bash on Ubuntu on Windows, Compile AOSP - android

I am attempting to compile AOSP code using the new WSL (Windows Subsystem for Linux) aka Bash on Ubuntu on Windows. I have successfully setup my build environment and sync'd AOSP code.
I am unable to get "make" to complete a build for even just a single app.
Attached is a strace file. Make seems to hang when reading the file "build/core/clang/TARGET_arm.mk" (this file is initialized on line 1443 of the trace), although this file is successfully read several times prior to the hang.
Any ideas about what is causing make to hang? How can I dig deeper to find out what is causing the hang?

Ehm, yeah, that was the only thing I've wanted to do with the bash since 30th of March when it was announced. I tried it out by myself and I also read an article at xda-developers four months ago that it currently isn't possible to successfully compile Android using this subsystem due to some missing dependencies. There's currently no solution to do that. We have to hope for an update which gives us this awesome possibility. Even if it'll work some day you will have to expect twice the build time you have on a normal Ubuntu setup. Anyway, the bash development is progressing so I'm full of hope it'll work in some months...

Related

Module not found running npx react-native start

I've been wrestling with this problem of a module not being found when starting from a new or existing (ejected from expo) react-native project. After searching SO for similar problems, the errors thrown in those problems were too different for me to piece a solution from them.
Here is the command line after running the exact command:
Module not found
So overall I don't know what's really going on here. Errors are being thrown in a lot of files that are abstracted from what I usually work on.
At first, I was working with an ejected expo project but stepped away from that to start a fresh react-native CLI project following the quick start guide from the docs. I followed everything with no obvious impediment until it comes to actually executing the project.
The first thing I tried was deleting the node modules and running npm install. Note: I did not delete the package-lock.json though. I also ran a command to --force delete the cache at some point. I think I did that before I tried to delete node altogether and start from the absolute latest LTS version. During the quickstart, I ran choco install -y nodejs.install openjdk8 which installed version 16 of node and jdk8. I did already have jdk11; am I not using this kit correctly maybe?
Earlier in the day, the trace to where the error could not be found did NOT include react-native-community/cli in the path until I ran the above choco install. So it had some effect but still, nothing about the actual error changed. In the docs, it says explicitly that react-native-cli (or something like it) is packaged in with node.js so there is no need to run npm install #react-native-commmunity/cli. But, I've read conflicting solutions saying that, in fact, I do need it. Alas, installing #react-native-community/cli or react-native-cli globally had no effect.
At this point, I'm assuming the information/file I need is there but my computer is pointed to the wrong place. In the folder 'Work' there is no #react-native-community\cli\build\bin.js.
The .bin folder in node_modules: react-native files in .bin
To be honest I don't really understand these files but maybe something warrants changing? I can post a picture at request but I'm doubting a change is needed here.
Thank you for reading. Hopefully, I can get this up and running because my only avenue to meet my user stories is to manipulate the native android code.
Well, I feel silly but I learned something.
The reason the command didn't work was because one of my folders was named 'Routing&DeliveryApp'. Apparently, having an ampersand in the name will throw off the computer. So, it was cut off right after the ampersand searching in a folder named 'DeliveryApp' which did not exist.
Still felt like a eureka moment though. Hopefully this might help someone in the future.

Enabled symlinks, but fire-app-builder wont work still

I'd like to think I am fairly experienced with Android Studio after a year of playing around with it in my spare time. I've recently wanted to start developing for the Amazon Fire Stick/TV, so I followed the tutorial here, word for word.
The problem I'm encountering has to do with the symbolic linking. I've typed the enable command into both the git and Windows command windows. When I check the status of symlinks in my git shell, it returns true. But when I compile the program my values-en-rUS/strings.xml reads
"../values/strings.xml"
Any help will be greatly appreciated, cheers.
L.Mellor, I updated the Fire App Builder docs with some more instructions that should hopefully address this issue. See the following:
Download and Build Fire App Builder
Configure Symlinks for Windows Without Admin Privileges
In particular, after cloning the repo, run the scripts in that second link.
If you have the chance to try this out and it solves the issue, will you let me know? Thanks.

Script to pull from POEditor timeout on Bitrise

Currently I have an automatic build pipeline to build android apk on Bitrise, one of the step before build is pulling translated language from POEditor. Previously, the build has run successfully until on around 30 May it starts to fail. The failure is because of a timeout when 'curl' to POEditor API.
The Bitrise stack I used is Android&Docker Ubuntu 14.04, the staff has stated it is hosted on Google Compute Engine. I have another pipeline to build ios app which pull from POEditor also, and it still working without problem until now.
The POEditor API is to export the language (https://api.poeditor.com/v2/projects/export).
As we stated in our private chat there was absolutely no change on the related infrastructure; the last time we changed anything port/network related was about half a year ago and even then we enabled a new port and that's all.
One thing you might want to try is to switch from the Ubuntu 14 stack to the Ubuntu 16 one, although the 14 one did not change for quite a while and should work, but this might worth a try.
You can also try to run curl with the --versbose or other flag to get more info about the issue. If you can provide more debug infos feel free to contact us any time!

Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

The issue I've had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay responsive but the build simply wouldn't progress. It also never generates any kind of error, so I can't really post any useful information. Once in a blue moon it might suddenly work, but nothing reliable.
Recently I found a post here on Stack Overflow where someone's Android Studio would get stuck on Gradle: build when he tried to create a new project, and he noticed that this issue didn't exist in the 32-bit version of Android. So I thought, why not try that. Turns out that building isn't an issue anymore, but assembleDebug is, when trying to build the application. As can be seen here.
Of course all these commands work flawlessly when run using command prompt and gradlew.
What I've tried so far:
Reinstalling Android Studio (including the removal of .AndroidStudioProject)
Upgrading Android Studio to the latest version
Removing any build files from projects
Creating completely new projects in Android Studio
Switching from 64-bit to 32-bit Android Studio
I'm running the latest version of Android Studio, using version 19.1.0 of the build tools, gradle v0.11+ and am on Windows 8.1.
Is there anything else I can try? This is starting to become seriously annoying. The last possible solution I can come up with is just doing a complete format and a fresh Windows installation.
I was experiencing the same problem, and the solution was very unexpected in my case: AVAST antivirus was somehow interfering with the Gradle:build process.
Deactivating this antivirus solved the problem!
Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.
For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.
My build.gradle looked like this:
repositories {
mavenCentral()
maven {
url "http://JRAF.org/static/maven/2"
}
}
compile "org.jraf:android-switch-backport:1.3.1
For me, this problem occurred when I was USB tethering using an Android device. The first build took anywhere from 5-10 minutes, and every subsequent build took about 3-7 seconds. I found that by disabling USB tethering, the first build completed quickly (and so would all subsequent builds). After the first build completed, I could reenable USB tethering.
If you have a fresh Ubuntu 14.04 with Android Studio 1.5, you may be missing a library. Try this:
sudo apt-get install lib32z1
Another stack overflow answer
It happens 1 in 2 times for me. The hack that works for me is File->Exit and confirm exiting. Then a message shows up telling me that Gradle is running and then all of a sudden the screen to choose the device shows up. I Click NO and all goes well again.
Anyway, still a bummer, but I have not found an answer yet.
My problem was that the Android Sdk executables were missing the executable bit. You can check some of your binaries like /Sdk/build-tools//aapt to see if they have permission to execute. If not you can solve it by running this on the Sdk folder
chmod -R +x ./
If you are behind a proxy on ubunthu you might need to set your gradle system wide proxy:
sudo nano ~/.gradle/gradle.properties
And enter the following entries:
systemProp.http.proxyHost=<Your Host>
systemProp.http.proxyPort=<Your Host Port>

Compiling on an ARM Emulator for use on an Android Phone

so I'm trying to compile a program on an ARM emulator (Quem and the laungauge is C) for use on an Android phone. This is because I can't get build-essentials and/or cmake on my android phone, but I do have Terminal Emulator and Busybox.
Anyways, I compiled the program last night (Took forever!) and when I tried to run it on Android today It was originally saying Permission Denied (Even though I have SU), I found out that it was because I need to have it as executable, but since the sdcard was a FAT32, I wasn't able to use chmod. So I mounted /system, and copied over the binary to there after chmod 777'ing it. And now it gives me ./myprogram: not found even though it is clearly there.
Doing some reading, people are saying it could mean there are missing libraries, but Android doesn't have the ldd command so I don't know how to find out what it's missing. Also, might be a game breaker, but I found out that my phone is on an ARMv7 where as the emulator is ARM926EJ-S will this make a difference?
Any input is great!
I makes little sense (IMHO) to compile on the emulator. It makes more sense to use a cross compiler to build your application and its dependencies. Please search for info on using the NDK.

Categories

Resources