Having built a release version of my app (on a Linux machine) I get an unexpected error on opening the app.
I build that same (release) build on a mac and there are no problems, using the same git tag. However, the output mapping.txt file is different on both machines. For a sanity check I diff the output of ./gradlew app:dependencies on both machines - identical. git log on both machines shows the same: commit bb70bcf36e8c0e1a3 etc etc. git status shows only app/build and build untracked. It doesn't look as though there's anything relevant hidden by .gitignore.
So - I'm getting different outputs from proguard on what seem to be identical inputs on two different machines. Any idea what's going on? (I know I'm going to be typing D'oh tomorrow...)
ps. the generated apk files are different on both machines.
I deleted .gradle dirs in both home and app directories on both machines. Now the app build on the linux box starts fine but generated (release) apks are still different on both machines (different SHA1 hashes). However, the apk sizes are very nearly the same..2264536 and 2264528 respectively and mapping.txt now the same...presumably apks should be identical generated on different platforms ?
And of course I don't know how the gradle caches contributed to the problem.
Related
Background
I have an Android app which uses native ARM64 executables (essentially GCC toolchain, extracted to app directory (/data/data/%package%/somePath) on the first run) to do some work. Due to Android 10 changes files in /data/data/.. can't have executable permission anymore.
Confirmed workaround
The workaround is to make executables look like shared libraries (libsomething.so) that are extracted by Android to /data/app/%package% dir with android:extractNativeLibs="true" in AndroidManifest.xml and are allowed to have executable permission. Symlinking might be useful to mimic the previous files structure.
The problem
The problem is that all the executables (aka new "shared libs") are packed into android apk with zip compression ratio (as apk is essentially just a zip file) which could be better if it's archived with 7zip for instance and together weight more than 100Mb which is app limitation on Android (for apk files).
The question and the proposal
How can i split the executables into a small part (that goes into /data/app/%package% and a large part (or just existing executable in /data/data/%package%)? The idea is that small executable just "loads and runs" a regular one. The benefit it that regular executable is compressed with 7zip and it makes apk size much smaller due to 7zip used with a better compression ratio.
I've been looking into direction of using of UPX but having no experience with it (note i will have to prepare executable on Mac machine (or Linux with VM or Docker) to run on Android ARM64). Also i've been thinking about creating of 7z sfx but it seems to be tricky (again, it have to be created on x86_64 and run on ARM64). Also I've found some similar QA (which recommends memexec() or fexecve()), but I'm not sure what's the optimal way to go.
Ideally I'd love to have some tiny "universal" ARM64 executable (or be able to compile it from the source code with Android NDK) that just accepts cmd and a regular executable path.
PS. App bundle and dynamic delivery modules as high-level alternatives are undesired for different reasons.
PPS. UPX did not work out of box for Android 10 (seems to be security issue).
I'm not very experienced in *nix operating systems and I'm trying to set up an embedded programming environment in WSL, but I'm getting hung up on basic issues. Last time I was working on this project I had downloaded some files (cargo and rustup, but that shouldn't matter), and I confirmed that they were there and working by getting the version number with -V.
After restarting my computer WSL doesn't recognize rustup or cargo as commands, and the folders don't show up with ls, even though they show up when I check for them in Windows Explorer.
The directory I've been working out of is %LOCALAPPDATA%\Packages\TheDebianProject.DebianGNULinux_76v4gfsz19hv4\LocalState\rootfs\home*user* which I'm pretty sure is the default. I’ve verified this by creating a .txt in WSL and finding it with Windows Explorer
Working on Windows 10 64-bit. I chose Debian for arbitrary reasons/ open to switching.
I’m not too worried about the files themselves, I just want to be able to avoid this in the future.
Firstly since you are new to WSL please be aware that the recommendations are to not under any situations edit or modify any Linux files inside of your %LOCALAPPDATA% folder using Windows apps or tools which includes moving files using file explorer. See this blog post from Microsoft https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/ If you do you can see corruptions missing files and crashes.
I have no experience with cargo or rust but it sounds like you didnt update your .bashrc (start up script) with details needed to add things to the environment on start up.
There are a few things you can do
Use the history command to look back at what you did when you installed things
Use sudo find / -name rust to look for the executable in your system
When using ls remember that files/folders that begin with a dot are hidden so you need to use ls -al to see them in the terminal
I assume you followed this guide for installation (or similar). If you did not and are still having issues please detail how you installed things.
I have a CodePush app that has three deployments: testing, staging and production.
I have different app builds that align with these:
A build that does out to testers (testing)
A build that goes out to a group of preview users (staging)
A production build (production).
How does CodePush know what deployment it should be sending to a build?
And how do I set up my app to make sure the right build (e.g. staging version of app) is getting the right deployment (e.g. staging deployment in CodePush)?
The CodePush server knows which deployment you want to query for updates against based on the deployment key which is configured in the config.xml file or is passed to the call to sync (with the later taking precedence). If you want to generate three separate builds for QA/staging/production, then you simply need to make sure you update the deployment key that is set in your config.xml file before running cordova build to generate the APK or IPA file.
Unfortunately, Cordova doesn't really have a standard way of defining multiple environments, which would allow you to add your per-environment keys to the config.xml and have the right one be selected when doing an environment-specific build.
Depending on how your app is structured, you could also skip the config.xml file completely, and just pass the deployment key directly to the call to sync(). Then, you just need to make sure your app defines all the neccesary keys in a config somehow and loads the correct one for each build. You can take a look at this starter project for an idea of how this could be generally done.
I have configured CodePush for my dev, test and prod environments. But my application is a react-native one. I think the same will works for Cordova as well.
The important point is CodePush identify particular app by it's CodePushDeploymentKey. First you should create 3 channels on AppCenter for dev, test and prod. Then setup CodePush on those 3 environments and Get relevant CodePushDeploymentKeys.
Then you have to add those 3 keys for 3 different targets on your app. For iOS you can create 3 different targets on Xcode with 3 different plist files and add those different CodePush keys in relevant plist files.
For android you can create 3 different Product Flavors for dev, test and prod and then add DeploymentKeys on each flavor.
In this article I have explained everything step by step with all the screenshots and links.
I have already waste 3 days "solving" this problem (actually I have tried everything i could imagine but get nothing).
While binary uploading of my application i get the following error:
ERROR ITMS-9000: "this bundle is invalid. armv7s are required to include armv7 architecture." at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage).
Oh I got it, what you only need to do is to disconnect your device (remove the cable connection between your device and system).
Now archive it and validate. You are good to go I believe. :)
Follow These steps while uploading binary:
Make you Project ready to go (Create distribution certificate, appstore provisioning profile with this certificate and application id of the application you are willing to upload, down load both and double click to install them)
Check if every thing is right, like right Icon files default files etc, and in build setting of your application you have selected your appstore provisioning profile to create you build.
Now unplug your device (although debug option should still remain selected to ios device) while archiving your build
After archiving is completed, validate your build (with same account you have created provisioning profile with), and then correct if there's some other errors, or upload the build otherwise.
I got this error, because arch (arm7, arm7s, arm64) + Build Active Arch Only - YES.
I did next:
- disconnect iphone
- exclude arm64-arch
- Set Build Active Arch Only - NO.
Build was successfully uploaded.
The problem to me was very lazy! I just lost the Universal Deployment Target (I had iPhone only for error). Fixed that it worked fine.
I tried removing the cable and re/assigning the provisioning profile(s) etc. In the end I just removed arm64 from the list of valid architectures on the project and target files.
How much does arm64 matter anyway?
First, I obviously tried to get a binary release of Mono.Fuse project, but the only available downloads were the source files. (And actually it seems that latest release has a syntax error in an override)
So I tried to install it on a Linux box from git, successfully, but I'll soon need to bring it to a production server together with my Xcopy-deployable application.
I don't like compiling software on a production machine, especially because I need to install loooooooooooots of development tools from YaST. So now I have this git-cloned directory with all source and compiled files.
How can I create an RPM package that I can install on multiple production machines with a simple command without resolving configure.sh's dependencies with lots of unneeded libraries like glib-2.0-devel?
Take a look at Open Build Service.