java.io.filenotfoundexception: /home/ljh/.android/analytics.settings (permission denied) - android

When I started Android studio, I got
could not initialize analytics, treating as opt-out. java.io.filenotfoundexception: /home/ljh/.android/analytics.settings (permission denied)
What should I do? My OS is Ubuntu 32bit

Solution is to install these 32 bit libraries on your ubuntu box
sudo dpkg --add-architecture i386
sudo apt-get -qqy update
sudo apt-get -qqy install libncurses5:i386 libstdc++6:i386 zlib1g:i386
Following are compile errors which are solved by issuing above commands :
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
Building Cordova app for Android \
:CordovaLib:generateReleaseBuildConfig
FAILEDding Cordova app for Android \
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
stack trace may also show these errors
BUILD FAILED
Total time: 37.372 secs
%% Command finished with error code 1: /home/stens/src/github.com/loudthink/loudspeed/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildRelease,-b,/home/stens/src/github.com/loudthink/loudspeed/.meteor/local/cordova-build/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Dorg.gradle.jvmargs=-Xmx2048m,-Pandroid.useDeprecatedNdk=true
=> Errors executing Cordova commands:
While building Cordova app for platform Android:
Error: /home/stens/src/github.com/loudthink/loudspeed/.meteor/local/cordova-build/platforms/android/gradlew: Command failed with exit code 1
Error output:
Could not initialize analytics, treating as opt-out.
java.io.FileNotFoundException: /home/stens/.android/analytics.settings (No such file or directory)

Maybe it has root permission, and not your user's.
You can see how in second command, root is the owner of folder.
I changed it to my user, and it works.
lucas#ubuntu$ ls /home/lucas/.android/
ls: no se puede abrir el directorio '/home/lucas/.android/': Permiso denegado
lucas#ubuntu$ ls -lart /home/lucas/ | grep android
drwxr-x--- 2 root root 4096 sep 14 14:02 .android
lucas#ubuntu$ sudo chown lucas:lucas /home/lucas/.android/
[sudo] password for lucas:
Fingerprint Login 1.09
Authenticating lucas
Swipe your finger or type your password:
lucas#ubuntu$ ls /home/lucas/.android/
adbkey adbkey.pub analytics.settings
lucas#LUCAS-ITECNIS:~/itecnis/simple/usuarios$ ls -lart /home/lucas/ | grep android
drwxr-x--- 2 lucas lucas 4096 sep 14 14:02 .android

Related

Getting an error for image at build time for Android 11.0(AOSP) on ubuntu 14.04 verion

PRODUCT_SOONG_NAMESPACES=hardware/google/av hardware/google/interfaces vendor/qcom/opensource/commonsys/packages/apps/Bluetooth vendor/qcom/opensource/commonsys/system/bt/conf
[100% 1/1] out/soong/.minibootstrap/minibp out/soong/.bootstrap/build.ninja
FAILED: out/soong/.bootstrap/build.ninja
out/soong/.minibootstrap/minibp -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/.bootstrap/build.ninja.d -globFile out/soong/.minibootstrap/build-globs.ninja -o out/soong/.bootstrap/build.ninja Android.bp
internal error: could not open symlink kernel/msm-4.14/Android.bp; its target (../../../../../../../code/SC665S_Android11.0_R02_r020/kernel/msm-4.14/Androidbp) cannot be opened
09:54:32 soong minibootstrap failed with: exit status 1
failed to build some targets
real 0m0.727s
user 0m2.252s
sys 0m0.392s
[build.sh]: FAILED: make dist –j4 ENABLE_AB=true SYSTEMEXT_SEPARATE_PARTITION_ENABLE=true BOARD_DYNAMIC_PARTITION_ENABLE=true ENABLE_VIRTUAL_AB=false SHIPPING_API_LEVEL=29
How to solve this error.
Thanks in advance.

Command failed with exit code enoent on IONIC 4

The error on the above title only occurs on this specific project, when I build a Blank project it doesn't get this error. I've tried the other solutions to this problem but I just can't seem to get this working.
Heres the error message:
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
ANDROID_HOME=C:\Users\ME\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_211
Running command: cmd "/s /c ""C:\Program Files (x86)\gradle-5.6.2\bin\gradle.bat" -p C:\Windows\System32\QRID2\qrid\platforms\android wrapper -b C:\Windows\System32\QRID2\qrid\platforms\android\wrapper.gradle""
Command finished with error code ENOENT: cmd /s /c ""C:\Program Files (x86)\gradle-5.6.2\bin\gradle.bat" -p C:\Windows\System32\QRID2\qrid\platforms\android wrapper -b C:\Windows\System32\QRID2\qrid\platforms\android\wrapper.gradle"
cmd: Command failed with exit code ENOENT
Error: cmd: Command failed with exit code ENOENT
at ChildProcess.whenDone (C:\Windows\System32\QRID2\qrid\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:198:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
This means ENOENT Error NO ENTity|ENTry so such derectory
check your gradle is located in C:\Program Files (x86)\gradle-5.6.2
Do you have the gradle installed on your machine?
Try it:
1 - download the gradle from the site gradle.org.
Download the .zip file and extract to disk C:\
2 - Set the Gradle Environment Variables.
In order for the Gradle executable to be visible on the Windows command line, you must set the GRADLE_HOME variable and expose it in the system path.
Example:
variable name: GRADLE_HOME
variable value: c:\gradle-2.5
and then add GRADLE_HOME to Path
;%GRADLE_HOME%\bin
Restart your PC and use de command line
gradle -version
To see if it works

Import source code of lineage os to Android Studio

I want to import source code of Lineage OS to Android studio, for that I am executing below commands
source build/envsetup.sh
then I am executing below command
make idegen && development/tools/idegen/idegen.sh
After executing the above command, I am getting below error
/home/amit/android/lineage/out/s.../android/lineage/out/soong/build.ninja
FAILED: /home/amit/android/lineage/out/soong/build.ninja
/home/amit/android/lineage/out/soong/.bootstrap/bin/soong_build -t -l /home/amit/android/lineage/out/.module_paths/Android.bp.list -b /home/amit/android/lineage/out/soong -n /home/amit/android/lineage/out -d /home/amit/android/lineage/out/soong/build.ninja.d -o /home/amit/android/lineage/out/soong/build.ninja Android.bp
error: vendor/lineage/build/soong/Android.bp:31:8: module "generated_kernel_includes": cmd: unknown variable \'$(KERNEL_MAKE_FLAGS)\'
ninja: build stopped: subcommand failed.
21:52:50 soong bootstrap failed with: exit status 1
#### failed to build some targets (10 seconds) ####
Does anyone have an idea, how to resolve this issue, thanks
I had the same error after following the LOS instructions for using Android Studio. I fixed it by lunching my lineage project:
source build/envsetup.sh
lunch lineage_XYZ-eng
make idegen && development/tools/idegen/idegen.sh
"lineage_XYZ-eng" is defined in my vendorsetup.sh at the root of my LOS device tree.

ionic build android error

I'm confused. jdk,sdk,ant,cordova,ionic doing well,why builds error?
I searched everywhere,but no answer for it.
I guess has a error version?
who can help this?
system:win8
jdk:1.8
ant:1.96
android:22
%ANT_HOME%\bin\;%ANDROID_HOME%\platform-tools\;%ANDROID_HOME%\tools\;%java_home%\bin;%java_home%\jre\bin;C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\
Path
E:\ionic\demo22>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" E:\ionic\demo22\hooks\after_
prepare\010_add_platform_class.js E:\ionic\demo22
add to body class: platform-android
Running command: cmd "/s /c "E:\ionic\demo22\platforms\android\cordova\build.bat
""
ANDROID_HOME=E:\adt-bundle-windows-x86_64-20140702\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_60
Running: E:\ionic\demo22\platforms\android\gradlew cdvBuildDebug -b E:\ionic\dem
o22\platforms\android\build.gradle -Dorg.gradle.daemon=true
Unzipping C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-all\2m8005s69iu8v0oiej
fej094b\gradle-2.2.1-all.zip to C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-
all\2m8005s69iu8v0oiejfej094b
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio
n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc
essManager.java:65)
... 3 more
E:\ionic\demo22\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "E:\ionic\demo22\platforms\androi
d\gradlew cdvBuildDebug -b E:\ionic\demo22\platforms\android\build.gradle -Dorg.
gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\cxt\AppData\Roaming\npm\node_modules\cord
ova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Error
I hope that not too late, but I had the same error and. So, I fixed it doing the next:
In your case find this:
C:\Users\cxt\.gradle\wrapper\dists\gradle-2.2.1-
all\2m8005s69iu8v0oiejfej094b
now you are here to delete the gradle-2.2.1-all.zip because this file is corrupted and then replace the file with this http://services.gradle.org/distributions/gradle-2.2.1-all.zip
when you finish all try again
ionic build android
Good Luck!
First of all you have to install
node.js
apache ANT
JDK & JRE
Android SDK & Eclipse
After installation, you have to set software paths into environmental- variable. Then fire your npm install -g cordova. Without this PhoneGap will not be created.
If still you have any confusion or question related to software installation then tell me.
I had the same issue on Mac.
The steps below solved that for me:
NOTE: gradle path & version would be different on your machine. please replace those informations with yours. you can get them from exception message
Download : http://services.gradle.org/distributions/gradle-2.13-all.zip
Get List of files in directory
sudo ls rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q
Remove existing zip file
sudo rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/gradle-2.13-all.zip
If there is a *.zip.lck file, you'd better remove that too..
sudo rm /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/gradle-2.13-all.zip.lck
Copy downloaded file to that path
sudo cp /Downloads/gradle-2.13-all.zip /var/root/.gradle/wrapper/dists/gradle-2.13-all/7hsc6vr6mi3i6i5m7q9hj4ci1q/
Then try to run
ionic run android

Android linphone prepare_sources.sh

I am trying to compile linphone for android but I'm but I can't manage to pass throw prepare_sources.sh.
I have installed all dependencies and download ndk. Is there a way to install ndk? I didn't found it!
I'm working in Ubuntu 10.11.
The output I get when I execute prepare_sources.sh is:
Applying patch to ffmpeg
patching file submodules/externals/ffmpeg/libavcodec/arm/int_neon.S
Hunk #1 FAILED at 35.
Hunk #2 FAILED at 55.
2 out of 2 hunks FAILED -- saving rejects to file submodules/externals/ffmpeg/libavcodec
/arm/int_neon.S.rej
cd: 12: can't cd to /home/glot/git/linphone-android/submodules/libilbc-rfc3951
iLBC prepare stage failed
find: «../../libvpx/»: No existe el archivo o directorio
cp: el destino, «../../libvpx/», no es un directorio
VP8 prepare stage failed.
cd: 16: can't cd to /home/glot/git/linphone-android/submodules/mssilk
SILK audio plugin prepare state failed.
Thank you very much!
If you still need an answer...
Open your terminal
make sure you have done this: "git clone git://git.linphone.org/linphone-android.git --recursive" //*the --recursive part is very important
then do this: apt-get install autoconf automake libtool pkg-config
go to your project root: cd/home/user/project //wherver your project is
in your project root: export PATH=/home/user/android-ndk:$PATH //wherever your android-ndk is stored in
then run ./prepare_sources.sh //in your project root still
after that do this: /home/user/android-ndk/ndk-build // in your project root too
I work in Mac but I get the same error and I found out that some changes in this file helped me:
linphone-android/submodules/externals/libvpx/build/make/gen_asm_deps.sh
Line 45, change it to :
includes=$(LC_ALL=C egrep -i "include +\"[a-z0-9_/]+\.${sfx}" $srcfile |
and do:
Go to root directory of the downloaded project through command: cd /home/your_downloaded_project_path/
Fire the command: ./prepare_sources.sh /home/android-ndk-r7b/
Go to root directory of NDK folder through command: cd /home/android-ndk-r7b/
Fire the command: export NDK_PROJECT_PATH=/home/your_downloaded_project_path/
./ndk_build clean
./ndk_build -i
Hope it helps.
NB:
I found it from here: https://groups.google.com/a/webmproject.org/forum/#!msg/webm-discuss/OdEWb-rBBhw/_GMux8jTOnoJ

Categories

Resources