I'm trying to use Jenkins with my Flutter project, however, when I build the project I get the following error
flutter command not found.
I have added the following code in the .bash_profile
export PATH=$PATH/Users/andrey/Developer/flutter/bin
I also have added the following in the Global properties:
Name:ANDROID_HOME
Value:/Users/andrey/Library/Android/sdk
Name:HOME
Value:/Users/andrey
Name:PATH
Value:/$PATH/Users/andrey/Developer/flutter/bin
I have the following shell script
#!/bin/sh
flutter build apk--debug
flutter test
The reason that it was failing is because the PATH variable was not exactly the same as when the echo $PATH was being inputed in the terminal.
I am not able to execute the sdkmanager from command line. if I execute ./sdkmanager --list, I got following exception
Error: Could not find or load main class java.se.ee
Any help on this?
I have solved my issue by removing -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee in the sdkmanager
It was originally
# Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
and I removed -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee.
Now I can run sdkmanager commands
I am trying to build OpenCV to include OpenCV contrib modules which is in a repository. I am following the instructions in this link, but i could not understand the cmd commands which is i mentioned in the section titled "cmd commands" as follows.
cmd commands:
$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules
<opencv_source_directory>
$ make -j5
here are my attempts to get the cmd commands as mentioned above running:
1-concerning the opencv_build_directory: i just created it by myself and named it 'build' as shown in the image in the section titled "OpenCV3.0.0 source"
2-concerning the opencv_source_directory: i think it should be "OpenCV-android-sdk" as shown in the image section titled "OpenCV3.0.0 source"
3- for the cmd command '$ cd ' i set it as follows:
c:\xxxx\libs\OpenCV-3.0.0-android-sdk-1\OpenCV-android-sdk\build>
4- for the cmd command '$ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules' iset it as follows:
cmake -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-master/modules OpenCV-
android-sdk
the entire command i type in the cmd is:
c:\xxxx\libs\OpenCV-3.0.0-android-sdk-1\OpenCV-android-
sdk\build>cmake -DOPENCV_EXTRA_MODULES_PATH=opencv_contrib-
master/modules OpenCV-android-sdk
but after running it, i get:
CMake Error: The source directory "C:/xxxx/libs/OpenCV-3.0.0-
android-sdk-1/OpenCV-android-sdk/build/OpenCV-android-sdk" does not
exist.
Specify --help for usage, or press the help button on the CMake GUI.
please help me to build the path correctly as stated in the linke mentioned
note:
I am trying to install opencv contrib modules on android through android Studio
OpenCV3.0.0 source
OpenCV-contrib source:
i am trying to install Phonegap on Ubuntu 13.04, i have installed the Android SDK with all available Packages, but running the following command:
cordova platform add android
fails with an unexpected error:
[Error: An error occured during creation of android sub-project. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY &>/dev/null exited with 1
Deleting project...
I have set the PATH Variables for Android (tools / platform-tools) and java and ant are installed.
Why does this happen? How can i get a more detailed error message?
have you tried running command with sudo?
it could be a permissions issue.
If still not working, try running it using verbose mode i.e. sudo -d cordova...
In case this is due to activity name whitespaces, see comments for this answer.
There is an issue reported in https://issues.apache.org/jira/browse/CB-4198, for which I've sent a pull request to remove whitespaces https://github.com/phonegap/phonegap/pull/39.
As #José said, the "hello" example doesn't work because spaces are not allowed.
Changing it to "HelloWorld" solves the problem.
remove the space in between name tags in config.xml
MyAppName< name>
In my case, using debian wheezy, the example from: http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-line%20Interface does not work with this error:
[Error: An error occured during creation of android sub-project. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY &>/dev/null exited with 1
Deleting project...
]
After adding $JAVA_HOME (Java sun, with openjdk did't work) and $PATH the andriod sdk path to .../sdk/platform-tools:../sdk/tool
The solution in my case was the project name:
The example that doesn't work:
cordova create HelloWorld com.example.hello "Hello World"
THIS works:
cordova create HelloWorld com.example.hello HelloWorld
Make sure your package and project names are correct, following the com.mycompanyname.myappname format without any numbers or dashes.
Here's the issue being tracked by PhoneGap.
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
OR try modify ~/.bash_profile using open ~/.bash_profile to full PATH
export PATH=${PATH}:/Users/cswjs/Documents/Dev/adt-bundle/sdk/platform-tools:/Users/cswjs/Documents/Dev/adt-bundle/sdk/tools
And use cordova create foo com.example.foo foo to create new project named foo. Make sure project name should be same.
Hope this could help someone!
IN my case there are many places in create script where u need to remove >null to see real logs. and i finally resolved my issues by
sudo chown -R sachinsharma ~/.cordova
Hi
I have run the command ./build/envsetup.sh on my source code of android while compiling.
I want to use the following commands present in the same file.
-cgrep
-mmm
-mm
but I get the following errors!!
Command 'pgrep' from package 'procps' (main)
Command 'fgrep' from package 'grep' (main)
Command 'egrep' from package 'grep' (main)
Command 'sgrep' from package 'sgrep' (universe)
Command 'grep' from package 'grep' (main)
Command 'lgrep' from package 'lv' (universe)
Command 'rgrep' from package 'grep' (main)
Command 'zgrep' from package 'gzip' (main)
Command 'dgrep' from package 'debian-goodies' (main)
Command 'vgrep' from package 'atfs' (universe)
Command 'ngrep' from package 'ngrep' (universe)
Command 'wcgrep' from package 'kdesdk-scripts' (main)
Command 'agrep' from package 'agrep' (multiverse)
Command 'xgrep' from package 'xgrep' (universe)
cgrep: command not found
How should I resolve this?
Do I need to make any changes in the envsetup.sh file?
The mm, mmm and cgrep are defined as shell functions. What does the following return for you:
set | egrep "^mmm \(\)|^mm \(\)|^cgrep \(\)"
On my environment I get:
cgrep ()
mm ()
mmm ()
If you are getting nothing back, you are probably sourcing the script wrong. Remember you can't just make the script executable and run it as it won't be exporting the functions back to your shell. You must use either:
. build/envsetup.sh
OR
source build/envsetup.sh
to ensure it runs in parent shell.
You need to return your android root content with this command in the AOPS root directory:
source ./build/envsetup.sh