I have a react native project in ubuntu, and I want to build android app for production.
I have read this article Generating Signed APK, which say run the following in a terminal:
$ cd android
$ ./gradlew assembleRelease
But when I run this I got this error message
sudo: ./gradlew: command not found
My question is what package I have to install on ubuntu to start build andriod's app
Related
I am using react-native 0.60 version and my Gradle version is 5.4.1. Now I'm trying to extract signed apk. When I execute, all the steps the apk build successfully. But When I checking this path F:\React Native\AwesomeProject1\android\app\build\outputs\apk
please check this screenshot https://prnt.sc/p391mr.
Use this command to generate release apk
react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Please follow this link
https://facebook.github.io/react-native/docs/signed-apk-android
You using this command
$ cd android
$ ./gradlew bundleRelease
You only generate android apk bundle (AAB)not an apk.The generated AAB can be found under
android/app/build/outputs/bundle/release/app.aab
On windows if you're going to use gradlew directly you need to run the windows variant of the command. See https://developer.android.com/studio/build/building-cmdline
So you should be running gradlew bundleRelease
From your screenshot you are running the *nix variant of ./gradlew bundleRelease. Note the removal of the leading ./ in the Windows version.
Here, I have built the react native android app using this documentation Doc
in jenkins which was configured on ubuntu 16.04 (in virtual machine).
Here is the build command which I used to build the react native app(android) in Jenkins
cd $WORKSPACE && chmod -R 777 ./android && cd ./android && npm install && ./gradlew clean && ./gradlew assembleDebug
The build process end successfully creating an apk file in the following path
build_release_v1/ws/android/app/build/outputs/apk/
Note build_release_v1 is the jenkins project name and ws is for the workspace of it.
Though the apk is created it comes up with following errors
What may be the case ....please help me with this ...Thanks in advance...
The problem is that if you want a debug build (since you are using assembleDebug), React Native generates an APK that expects to have a connection to the bundle server (it does the same as react-native run-android). My guess is that you want to test the app without the bundler, so you have two options: either run assembleRelease instead (have a look here for more details) or manually create the bundled JavaScript code and then create the APK. Please refer to this question for details.
Hi I was successfully created my first phonegap application by running
$ phonegap create percentage
Now i want to run it. So I run this command:
phonegap run android
However it throw me this error:
http://pastie.org/9076710
Anyone have idea about this?
Thank you
Try this one
Install ant using brew.
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Run the PhoneGap build again and it should successfully compile and install your Android app.
I,m unable to add android platform support to phonegap/cordova project.
when I run following command on CLI :
cordova platforms add android
it's giving this error :
Error: ERROR : executing command 'ant' , make sure you have ant installed and added to your path
you need to clean up your eclipse
cd to your eclipse directory and run this command
./eclipse -clean
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Build project
cordova build android
I have installed Cordova along with Phonegap and installed node.js in my system(ubuntu)
by using following commands:
Install Nodejs http://nodejs.org/
Install Cordova 3.0.x
$ sudo npm install -g cordova
Install Phone Gap 3.0.x
$ sudo npm install -g phonegap
Then i created project using phonegap command:
$ phonegap create hello
Trying to run into my local by using following command:
$ phonegap local run andriod
Now at first i am getting following error:
shoaib#shoaib:~/Documents/hello$ phonegap local run android
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin/create: line 54: jar: command not found
This i solved by running following command:
ls -la /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin
Now when i again run
$ phonegap local run andriod
I am getting below error:
root#shoaib:/home/shoaib/Documents/hello# phonegap local run android
[phonegap] compiling Android...
[error] An error occurred while building the android project. /bin/sh: 1: /home/shoaib/Documents/hello/platforms/android/cordova/build: not found
I am using Android SDK 17
and version as 4.2.2 .
Any solution for this issue?
I had a similar problem. build and run were missing along with a few other files and lib was an empty directory. Downloaded cordova-android from here extracted and copied everything from its /bin/templates/cordova/ to the project (/platforms/android/cordova/). Then I could build and install the app.
Still had to start the emulator, check the running emulator with platforms/android/cordova/lib/list-started-emulators and then pass it when installing or it would take forever to install it on an emulator.
$ platforms/android/cordova/lib/list-started-emulators
emulator-5554
$ phonegap install --emulator=emulator-5554 android
I had already installed the JDK but the same error.
To fix this I just removed the phone test project and make sure that:
Java, javac and jar where in the path
(both should work)
java -version
javac -version
jar -version
Android sdk path was properly set and JAVA_HOME environment variable was properly set.
Then I remake the project and everything worked.
Hey got the solution.
I install open jdk 6.0 and problem is resolved.