i see "Error:C:\Documents and Settings\Student.gradle\daemon\2.8\registry.bin (The process cannot access the file because it is being used by another process)" in android studio...how to solve it...
Test this method .
You use a proxy like freegate
Run cmd and goto to main folder project .
And run this code gradlew -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8580
proxyPort=Your used proxy
Related
I would like to extract my app in .apk format.
I add these script on my "package.json" page:
"build:development:android": "ionic cordova build android"
and "build:production:android": "ionic cordova build android --prod --release".
But, when I type the commands I have Errors.
What I should do to have my .apk file?
I am novice. Any help would be much appreciated. Thanks.
aha! I can see the problem in your code !
you are generating pages from ionic generate command! but if you see the file structure you will find that the page folder has its own module file! first delete that and then go to yourPage.ts file and delete the import of ionicPage and also remove the Annotation of ionic page.... Repeat this step for all pages which have this module file in them!
after that make sure your pages are imported in your app.module.ts
here lemme show you an example how it is done! consider I have a class called testerClass. its page structure on using
ionic g page testerClass will be as
delete that tester-class.module.ts
Step 2: AFTER deleting that you have to go into tester-class.ts and
remove the annotation and import of ionic page like shown in picture
**
NOTE!!make sure you run the build commands using admin/root pre villages (if you are not using root account just in case). in simple words search your cmd in windows search option right click and open as administrator
**
I think you encounter 2 problems and I will try to refer to them based on the screenshots.
Screenshot #1: I believe this is a permissions error, if you run the same command as an admin do you have the same result? In order to run it as an admin you will:
type 'cmd' in your search bar bottom at the windows bar
when the results emerge, right click on the command line and hit 'run as administrator'
Screenshot #2: This is a code error but it is simple to fix.
It seems that you have added the Album page via ionic generate page AlbumPage but then added that to your app.module.ts.
The result is that AlbumPage is declared on both app.module.ts and album.module.ts.
Since AlbumPage is built to be an Ionic Page (if you navigate in album.ts, right above Component annotation, you will se the IonicPage() annotation) you can remove it from the app.module.ts, and wherever you are referring to this page you can use the string of the name e.g. this.setRoot('AlbumPage'), instead of this.setRoot(AlbumPage), which also means that you do not have to import it.
Python for Android (Py4A 2.6) is wonderful!!! But QPython (2.7) is a lot more powerful and continuously developed. Now I try to integrate Qpython's Python into Android (5.1 CM12) Terminal / ADB described in this Tutorial:http://wiki.qpython.org/en/diveinto/
My Script to import the environment variables qpython needs looks like:
TERM=screen
PATH=/data/data/com.hipipal.qpyplus/files/bin:/system/bin:/system/xbin
LD_LIBRARY_PATH=.:/data/data/com.hipipal.qpyplus/files/lib/:/data/data/com.hipipal.qpyplus/files/:/data/data/com.hipipal.qpyplus/lib/
PYTHONHOME=/data/data/com.hipipal.qpyplus/files
ANDROID_PRIVATE=/data/data/com.hipipal.qpyplus/files
PYTHONPATH=/storage/emulated/0/com.hipipal.qpyplus/lib/python2.7/site-packages/:/data/data/com.hipipal.qpyplus/files/lib/python2.7/site-packages/:/data/data/com.hipipal.qpyplus/files/lib/python2.7/:/data/data/com.hipipal.qpyplus/files/lib/python27.zip:/data/data/com.hipipal.qpyplus/files/lib/python2.7/lib-dynload/:/storage/emulated/0/com.hipipal.qpyplus/scripts
PYTHONSTARTUP=/storage/emulated/0/com.hipipal.qpyplus/lib/python2.7/site-packages/qpythoninit.py
PYTHONOPTIMIZE=2
TMPDIR=/storage/emulated/0/com.hipipal.qpyplus/cache
AP_HOST=127.0.0.1
AP_PORT=58418
AP_HANDSHAKE=01805a68-c04c-4e21-bd54-ac8732f3a8da
ANDROID_PUBLIC=/storage/emulated/0/com.hipipal.qpyplus
ANDROID_PRIVATE=/data/data/com.hipipal.qpyplus/files
ANDROID_ARGUMENT=/storage/emulated/0/com.hipipal.qpyplus/scripts
Shell session:
u0_a101#C1905:/ $ source /sdcard/qpyenvnew.sh
u0_a101#C1905:/ $ $python
u0_a101#C1905:/ $ hmm do nothing?!
I get no output.
I have found here on Stackoverflow the same Question but the posted solution ist a link how is down.
Other Tutorial on throws only errors
http://dinostest.com/node/28
Try this command in your terminal:
$sh data/data/com.hipipal.qpyplus/files/bin/qpython.sh
Terminal will prompt a Python console.
If your script for the environment variables was obtained by running the code from the tutorial link, it should be correct.
If what you have pasted is exactly what you entered, the problem would be that you tried to run pyhton by typing $python when it should have just been python
Pre-fixing with $ is used to reference the value of a variable, so entering $python referenced the value of the variable python but does nothing with it, hence no feedback.
EDIT2: Although it's not a direct answer to this question I suggest having a look at the App 'Termux'. You can install Python2/3 via apt, virtualenv/-wrapper etc... Much more powerfull!
EDIT: Since /data/data... is only accessible as root, the following must be done as root!
Take care that the python executables path is in your $PATH. That wasn't the case even after having run the script from the tutorial (your script). If it's not present simply type:export PATH=/data/data/com.hipipal.qpyplus/files/bin:$PATH
or follow theses steps. In short: create a file in /sdcard (here ".bashrc") with the above line. After that type: source .bashrcsource init.sh (init.sh is located in /data/data/com.hipipal.qpyplus/files/bin as well) Then fire up Python with python-android5 which is the PIE compatible executable for Phone with Lollipop and above. But be aware: For whatever reason I couldn't exit() or quit() the Python prompt but I was able to run Script from the Terminal! Have fun!
EDIT: I spotted this: PythonForAndroid. It is a fork of PythonForAndroid that is still alive, and this versions are able to run on Android L (Python3 on 5.1.1 in my case). Also check the SL4A linked there, it works great on Lollipop.
Thanks to the answers above I made a super easy solution. If you have root: Create a file "python" and type the following line in it:
sh data/data/com.hipipal.qpyplus/files/bin/qpython-android5.sh
Place this file in your /system/bin directory and you can access python from everywhere using the command 'python'.
I installed the all the recommended programs from PhoneGap's Getting Started Guide and followed the various steps.
I created the .bash_profile file and it looks like this:
export PATH=${PATH}:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools
The Development folder is located on my desktop. Upon navigating in terminal to my bin directory and creating a new PhoneGap project, i did like so:
./create /Users/joey/PhoneGapExample nl.symvoli.phonegapExample PhoneGapDemo
I get the following error:
An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...
I searched around what might cause this problem and everything seems to be pointing to value of the $PATH environment variable. When i ran echo $PATH in my terminal, it returns this:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Development/android-sdk-mac/sdk/platform-tools:/Development/android-sdk-mac/sdk/tools
Any help would be much appreciated.
I'm on a Mac, running Mac OSX 10.8.3
just command this in terminal/console
export PATH=${PATH}:"/Applications/Android Studio.app/sdk/tools":"/Applications/Android Studio.app/sdk/platform-tools"
check with echo $PATH and you show this
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Applications/Android Studio.app/sdk/tools:/Applications/Android Studio.app/sdk/platform-tools
have you executed the ./create script with sudo?
if you run the script with sudo:
sudo ./create .....
you have another environment setted.
otherwise you have to export ANDROID_BIN variable
export ANDROID_BIN=/<your_android_sdk>/tools/android
I had the same issue. For me the issue was that I had set the PATH variable as described in step 3 of the tutorial, but I made a mistake and the PATH I specified was actually wrong.
So if it does not work with sudo, you might want to try and check the path again.
When I ran ./create I immediately received an error:
An unexpected error occurred: ANDROID_BIN="${ANDROID_BIN:=$( which android )}" exited with 1
Deleting project...
If you open up the create file (phonegap-2.7.0/lib/android/bin/create) with textEdit, there is a line that lists
ANDROID_BIN=”${ANDROID_BIN:=$( which android )}”.
The “which android” is the cause of the issue
If you replace this line with the full path to your android tools (SDK), it should resolve the issue. It looked like this:
ANDROID_BIN=/Users/cswjs/Documents/Dev/adt-bundle/sdk/tools/android
Hope this could help someone!
you can also try this
1.
open ~/.bash_profile
2.
export PATH=${PATH}:"/Users/**username_here**/Documents/adt-bundle-mac-x86_64-20131030/sdk/platform-tools:/Users/**username_here**/Documents/adt-bundle-mac-x86_64-20131030/sdk/tools"
3.
source ~/.bash_profile
Close Terminal, open Termial again and ...
just like found in here: http://yandr.randy.boy.jp/?eid=6
didn't understand a word but saw the last link and it worked for me :D
I've the same issue, in my configuration (mac pro + android studio) the sdk path was "/Applications/Android Studio.app/sdk". The problem is how you specify in "export $PATH=..." a new path added (/Application/Android Studio.app/sdk/tools and so on), seem that using '"' work with export $PATH for bash but does not work with script "create" with Phonegap. My end solution it's to move sdk in an alternative directory without blank in is name.
This is probably because of a wrong PATH. Refer this blog post
I put in reference this:
http://developer.android.com/guide/google/gcm/demo.html
in Using App Engine for Java number 4
I am supposed to run this on a cmd inside the samples/gcm-demo-appengine directory :ant -Dsdk.dir=/opt/google/appengine-java-sdk runserver -Dserver.host=192.168.1.10
I replace the "192.168.1.10" with "127.0.0.1" which is my locolhost.
after executing this command I got:
BUILD FAILED
C:\Program Files (x86)\Android\android-sdk\extras\google\gcm\samples\gcm-demo-ap
pengine\build.xml:27: Cannot find C:\opt\google\appengine-java-sdk\config\user\a
nt-macros.xml imported from C:\Program Files (x86)\Android\android-sdk\extras\go
ogle\gcm\samples\gcm-demo-appengine\build.xml
can you tell me what the problem?
Go to the following link:
[https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Java]
And download appengine-java-sdk-1.9.3.zip
So than extract it where you want and use the following path for example:
C:\programs\appengine-java-sdk-1.9.3
so you will use :
ant -Dsdk.dir=C:\programs\appengine-java-sdk-1.9.3 runserver -Dserver.host=1.1.1.1
where you have to replace 1.1.1.1 with your server's ip
I'm trying to get PhoneGap working. I've hit a hurdle getting started.
I've downloaded version 0.9.1. I've been following the instructions at http://phonegap.pbworks.com/Getting-started-with-Android-PhoneGap-in-Eclipse
Using MacOS 10.5.8. Android SDK is already installed and working with Eclipse.
My .bash_profile file looks like this:-
$PATH=/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin
export PATH=${PATH}:/Applications/android-sdk-mac_86/tools
export PATH=$PATH:/Applications/phonegap-android/bin
(and I restarted my terminal window to make it take effect)
I've tried the following command:-
cd /Applications/phonegap-android/bin
ruby ./droidgap /Applications/android-sdk-mac_86 HelloPhoneGap com.myidentity.android /Users/myidentity/Documents/workspace/HelloPhoneGap/assets/www /Users/myidentity/Desktop
...and I get the following error:-
./droidgap:4:in `require': no such file to load -- /Applications/phonegap-android/bin/lib/generate.rb (LoadError)
from ./droidgap:4
Why?
I ran into this issue as well, move droidgap up one level into the phonegap base directory.
Or, you should mention the complete path:
export PATH=$path: /Applications/phonegap-android/bin/**droidgap**
I came across such issues too. go to https://github.com/jonathanstark/phonegap-android, search the generate.rb file in the lib folder there, download it, then you are good to go.