How to add prebuild app in data in AOSP source code - build

regarding to this post, I have set
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)
After building the App is located in data, but it is not shown/available after booting. it is not found in App drawer nor in Setting/apps
Is there something I have done wrong?

Related

Why is `eas` ignoring my `package.json` when building my project? Specifically, the `bundleIdentifier` is not being found

When running eas build --platform ios from Expo, I get the following error your project must have a bundleidentifier set in the expo config (app.json or app.config.js)., but I do have a bundleIdentifier set in app.json, under expo.ios.bundleIdentifier.
This guide was helpful in debugging.
In my case, it turned out my app.json file was in my .gitignore (because it's code genned from other files in my project so I don't want it committed), and eas doesn't upload files that are .gitignored.
I therefore solved it by introducing a .easignore in the root of my directory that did not exclude app.json.

Using custom fonts on shinyapps.io

I would like to use a custom font in my shiny app (on plots) on shinyapps.io. I have my Roboto-Regular.ttf in the ./www/ directory. And this is the upper portion of my app.R file:
dir.create('~/.fonts')
system("chmod +x ./www/Roboto-Regular.ttf")
system("cp ./www/Roboto-Regular.ttf ~/.fonts/")
system('fc-cache -f -v ~/.fonts/')
system('fc-match Roboto')
library(ggplot2)
library(shiny)
library(shinythemes)
library(extrafont)
font_import(pattern="Roboto",prompt=FALSE)
loadfonts()
print(fonts())
Upon deploying the app, I end up with an error that looks like this:
Registering fonts with R
Scanning ttf files in /usr/share/fonts/, ~/.fonts/ ...
Extracting .afm files from .ttf files...
/home/shiny/.fonts/Roboto-Regular.ttfWarning in gzfile(dest, "w") :
cannot open compressed file '/opt/R/3.5.1/lib/R/library/extrafontdb/metrics/Roboto-Regular.afm.gz', probable reason 'Permission denied'
Error in value[[3L]](cond) : cannot open the connection
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Does anyone see what might be wrong?
After a bit of struggle I found an even simpler solution that works on shinyapps.io:
Here we go:
Place custom font in www directory: e.g. IndieFlower.ttf from here
Follow the steps from here
This leads to the following upper part of the app.R file:
dir.create('~/.fonts')
file.copy("www/IndieFlower.ttf", "~/.fonts")
system('fc-cache -f ~/.fonts')
Since Linux looks into the .fonts directory to search fonts, you don't need the extrafont package, but you can directly use those fonts like:
ggplot(mapping=aes(x=seq(1,10,.1), y=seq(1,10,.1))) +
geom_line(position="jitter", color="red", size=2) + theme_bw() +
theme(text=element_text(size = 16, family = "IndieFlower"))
This is the answer I received from RStudio regarding this. I haven't tested this out myself.
Hi,
Our developer was able to advise this is due to a possibly unfortunate design choice made when they created extrafont and the associated extrafontdb package. The extrafont font database is stored in the extrafontdb package directory -- that's essentially all that the extrafontdb package is used for.
This means that the extrafontdb directory needs to be user-writable. If the user installs the package, this will work fine, but if root installs the package (as is the case on shinyapps.io), then it won't work.
One potential workaround is to install the extrafontdb package to library that is in subdirectory of the app.
To do it: create an r-lib/ subdir, and download the extrafontdb source package there:
dir.create('r-lib')
download.file('https://cran.r-project.org/src/contrib/extrafontdb_1.0.tar.gz','r-lib/extrafontdb_1.0.tar.gz')
When deployed, the app will include this r-lib/ subdirectory and the extrafontdb source package.
Then, at the top of the app, install the extrafontdb package from the source package, into the r-lib directory.
.libPaths(c('r-lib', .libPaths()))
install.packages('r-lib/extrafontdb_1.0.tar.gz',type = 'source',repos = NULL)
They deployed an app on shinyapps.io that does the extrafontdb installation, and it works fine. The libpath is set so so that install.packages() will install from the provided source package to the r-lib/ subdirectory of the app.
Please let us know if you're able to implement the above or have any additional questions.
Thanks,
Adding an alternative answer to symbolrush's answer which I found did not work. Here was the code I used initially:
# Add fonts to shiny linux server
if (Sys.info()[['sysname']] == 'Linux') {
dir.create('~/.fonts')
fonts = c(
"www/IBMPlexSans-Regular.ttf",
"www/IBMPlexSans-Bold.ttf",
"www/IBMPlexSans-Medium.ttf"
)
file.copy(fonts, "~/.fonts")
system('fc-cache -f ~/.fonts')
}
# Load fonts and set theme
font_paths("fonts")
font_add("IBMPlexSans", regular = "IBMPlexSans-Regular.ttf")
font_add("IBMPlexSans-Bold", regular = "IBMPlexSans-Bold.ttf")
font_add("IBMPlexSans-Medium", regular = "IBMPlexSans-Medium.ttf")
showtext_auto()
The bizarre thing is that the first instance of the app on shinyapps.io worked, including the custom fonts. However when the app went to sleep and was opened a second time, I get this error in the log:
Error in value[[3L]](cond) : font file not found for 'regular' type
I was never able to debug why this was the case, but I tried a simpler solution that has worked perfectly so far. I moved my fonts to a /font folder in the app folder (I don't think using the /www folder is necessary) and added the /font folder using path_folder():
library(showtext)
# Load fonts and set theme
font_paths("fonts")
font_add("IBMPlexSans", regular = "IBMPlexSans-Regular.ttf")
font_add("IBMPlexSans-Bold", regular = "IBMPlexSans-Bold.ttf")
font_add("IBMPlexSans-Medium", regular = "IBMPlexSans-Medium.ttf")
showtext_auto()
I hope this helps anyone who is having problems with their app not running after the first instance, as I could not find the same situation anywhere on stackoverflow.

Sonar coverage and unit tests working, but cannot view test sources

I'm generating coverage and unit test reports with js testdriver and then using the output with sonar runner.
Although all the sources appear in sonar along with correct test coverage and test results, whenever I click on source for the tests themselves I just get "Could not find source for unit test: Chrome_290154776_Windows.CurrencyTest in any of test directories"
See the following screen shots:
The only obvious thing I notice is that the browser/os name has been added to the test class name, but that hasn't been an issue before, is this fine usually?
Additionally if I try and view coverage by clicking on "Coverage" on the dashboard and then browsing to the classes which are unit tested, they don't appear. I can however browse to the class manually (clicking files from the dashboard for example) and even bring up the code coverage from there!
See these to illustrate:
Could this be a result of the previous problem or is it unrelated?
As far as I can see sonar.tests in sonar-project.properties is pointing to the correct directory. My folders are laid out like this:
myProject > src > main
myProject > src > test
myProject > target
sonar-project.properties looks like this
# required metadata
sonar.projectKey=Core-1.0-SNAPSHOT
sonar.projectName=Core
sonar.projectVersion=1.0-SNAPSHOT
# optional description
sonar.projectDescription=
# path to source directories (required)
sonar.sources=src/main
# path to test source directories (optional)
sonar.tests=src/test
# Advanced parameters
sonar.javascript.jstestdriver.reportsPath=target/jstd
sonar.javascript.lcov.reportPath=target/jstd/jsTestDriver.conf-coverage.dat
sonar.dynamicAnalysis=reuseReports
# The value of the property must be the key of the language.
sonar.language=js
# Encoding of the source code
sonar.sourceEncoding=UTF-8
# Additional parameters
# sonar.my.property=value
I'm reaching the end of my tether with this, it just isn't making any sense to me. Any help would be much appreciated!
Cheers
Seeing the same issue. On sonar stack 1.4 with Javascript plugin 1.4. Had to downgrade this plugin from 1.5 to 1.4 to get the jstest property to work below. Sonar 3.74
My tests are in the test directory off off my project and my javascript is in the js directory.
Sonar-project.properties
sonar.projectKey=karma
sonar.projectName=karma test
sonar.projectVersion=0.0.1
sonar.sources=js
sonar.tests=test
sonar.language=js
sonar.dynamicAnalysis=reuseReports
sonar.javascript.jstest.reportsPath=reports
sonar.javascript.lcov.reportPath=reports/PhantomJS 1.9.7 (Mac OS X)/lcov.info
16:44:35.371 DEBUG - Parsing JsTestDriver run results in Surefile format from folder /reports
16:44:35.488 DEBUG - Adding unittest resource: org.sonar.api.resources.File#74c6fd6e[key=PhantomJS 1.9.7 (Mac OS X).Calculator,dir=,filename=PhantomJS 1.9.7 (Mac OS X).Calculator,language=JavaScript]
16:44:35.501 INFO - Sensor JsTestSensor done: 131 ms
I'm suspiciously looking at "dir=" in my sonar report above. Not sure how to set it yet.
Has anybody had any more success with the sonar 1.5 stack?

Trouble getting a Qt Reference Document program to work(Minehunt)... its just blank when run... no errors though?

http://docs.huihoo.com/qt/4.7/demos-declarative-minehunt.html
When I build and run... I just get a blank white rectangle... game is MineHunt.
The source code is in the URL. I created files and copied and pasted into Qt Creator 4.7.
Running in Linux.
No need to downvote. Deploying qml apps does not seem to be easy for beginners. jdl, I don't know if I can help you. Currently I am only on Linux. But what I did:
I copied the whole folder minehunt in my destination folder (/tmp/mine). When I ran qmake I got:
WARNING: Include file
/tmp/mine/helper/qmlapplicationviewer/qmlapplicationviewer.pri not
found
So I also copied the examples/declarative/helper folder into /tmp/mine.
Looked like this:
/tmp
/mine
/minehunt
/helper
Then I changed into minhunt, did 'qmake' and 'make'. A few seconds later I had a working minehunt binary in /tmp/mine/minehunt/.
I'll try tomorrow the Windows build.
Edit: Ok, tried now under Windows 7. Qt4.
QtCreator opened.
Project ...qt\demos\declarative\minehunt\minehunt.pro
loaded. Normally in release mode compiled. No problem. A file minehunt.exe was created in ....qt\demos\declarative\minehunt\release. Started: White screen. Exactly as you described it. In ...qt\demos\declarative\minehunt I found a folder 'qml'. I moved this folder and the minehunt.exe into another folder (myMineFolder). Simulating a simple deployment this way. Clicked on minehunt.exe -> worked like a charm.
So my folder layout:
myMineFolder
qml
minehunt.exe
But of course, I have set my PATH variable correctly to my Qt installation.

Uploading files with an ImageField and saving them to a static location

I have a problem with my app here. My configuration is as such I can upload a new release and symbolically link it for production -- however, this means every time I upload a new release, all of the photos that were uploaded in any parts of my entire project are wrapped into the old release and disappear.
How can I save these files to a static file location which does not get wrapped in the release? Thanks in advance.
I guess best for this is keeping your media files out of your source project folder, you could eg have a structure like:
myproject
|
|----media
|----src
There's no need to have the media folder in the same directory as your source code, apps etc. So you have a solution where the dir with your release only contains static files! The same applies to the database, if you are using sqlite... Have a look at this for a more detailled structure!
Of course this no must, but experience shows it makes live much easier!