How to generate apk of react native app without Android Studio - javascript

I have developed a react native app without installing Android Studio. Though I have installed some tools which were absolutely needed for the development.
My Android folder structure is something like this:
Android
.temp
build-tools
cmdline-tools
emulator
licences
patcher
platforms
platform-tools
tools
.knownPackages
Now that I have completed making my app with react native, I want to build an apk (valid and signed) of that and upload it to google drive as of now and share it with my friends, But the problem is, my potato cannot support Android Studio
I could have used expo, but everyone who wants to install my app will have to install expo client app first which is a problem
I hope my sisters and brothers will help me, I am completely new to android-development.
Thanks.
EDIT:-
I was using a real android device for development till now

This solution is for React-Native CLI , don't know it will work with EXPO.
first generate keystore file using in terminal go to java bin folder and then run this
keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
after that paste that generated keystore file in your android app folder
after that you have to add configuration in your gradlw.properties file
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=*****
MYAPP_UPLOAD_KEY_PASSWORD=*****
and also change in app/build.gradle file :
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
then
$ cd android
$ ./gradlew bundleRelease
for better guidence visit :
https://reactnative.dev/docs/signed-apk-android

If you are using Expo managed flow then you dont need any IDE for build creation, not even macOS machine for ipa, just couple of commands and your build will be ready in 30 min depending upon queue on turtle server.
If you are working with bareflow or React CLI then. you will. be needing assistance of IDE for build creation of both platforms and mac machine for iOS.
For help on commands for build creation on expo managed flow, use this link
Creating android build from Android studio, you can take help from here
Regarding your concern related to build sharing, expo gives you a link from where people can download the APK or IPA. That would ease out the problem related to build sharing

Related

Phonegap build final apk file locally without phonegap build website

I use Phonegap CLI to make my android apps every thing works fine, but when I want to make my final .apk I face a problem
I have SDK JDK Java and all environment variables
I generated my .keystore and when i run phonegap build --release i have no error my problem is this
there is no folder called bin or any .apk file in my folder
I red all documents and questions from stackoverflow and I still have this problem
what do you think? should i switch to cordova CLI ?
PhoneGap has been discontinued.
Switching to Cordova CLI is certainly an option, but many find that installing the build toolchain is a lot of trouble to get working (and keep working).
If you prefer the convenience of a build service like you had with PhoneGap, have a look at VoltBuilder, Ionic or Monaca.

How to fix app crashing on IOS devices react-native

I am building for first time an React - Native Application . Until now we have tested the application on the several Android devices and no problem has been detected . But when the application is runned on Ios devices it crashesh almost instantly . So my question is am i doing something wrong ? I followed up the documentetion from the react-native web page and i have done the right installs , but still the problem occurs . Also when i try to build up an Android or IOS simultaor with the command :
react-native run-android
react-native run-ios
It throws me an error :
Android project not found. Maybe run react-native android first?
Or for Ios :
iOS project folder not found. Are you sure this is a React Native project?
Error: iOS project folder not found. Are you sure this is a React Native project?
My folder looks like this :
Am i missing something that should be installed ? Can you givev me some hints ? Thank you !
PandaMastr, the example image indicates that this an expo react native application, to run it you will need to go the root folder and run npm start which will launch the application. In order to use the react-native run commands you would need to eject the application ( always make a backup so you can revert if need be ); which would then create the android and iOS folder and install the react-native run aspects you are attempting to use.

Cordova app installation crashes on android

Today I am trying to make a cordova app out of my existing website.
This seems to be pretty easy but there are some errors for me.
After installing everything and creating a new cordova project I only added this line in the index.js:
window.location = "http://myHomePage.net";
This should be enough for using your hosted website in a cordova android app.
And it really seems to work on my emulator but when I build the release for the app with:
cordova build --release android
and try to install the output apk my phone says:
app was not installed
How is this possible and does somebody know this issue?
The answer is don't use cordova build --release android!
cordova build android works.

Adding Cordova Platforms

Hey, Guys! I recently started to work with Cordova and when I run the Cordova platform add android i get the following error. I have successfully placed the environment variables for Java and for the Android SDK as well. But the npm modules does not exist in C:/Windows/System32/npm as shown in the error, It is in the Users/My username/AppData/Roaming/npm folder. Some guidance would be appreciated.
I followed the following scripts which are shown in the official Cordova documentation to create a new project.
Cordova create hello com.example.hello HelloWorld
cd hello
Cordova platform add android -> where I'm stuck at
Kindly Check the Android Version Provided by Cordova and verify with your current Android version installed on your system , if there a mismatch :
1) Update Android Version From Android Studio SDK Manager
2) Update Cordova Platform - Refer: Cordova Documentation
External Source
cordova - Error: Failed to fetch platform android
I figured out halfway what the the problem was. There was a file named 'npm' in my C:/Windows/System32 directory wich was of 0kb size, and once i deleted it, the error vanished. But not all the way though. I was able to install the browser platform but not the android platform via cordova platform add android or even specifying what the matching cordova-andriod pluggin to be with cordova platform add andriod#version.
Only through the cordova platform add https://github.com/apache/cordova-android.git script I could install the andriod platform and once it was done other steps worked fine, and the project ran through the Android AVD. Any idea why the normal command to add the android platform didnt work, Just want to know but if it happens again i think Im gonna have to run the get from git command again. Thanks

Run cordova phonegap through a specific ide

I would really like if someone of your very well-known community could help me.
Here is what I try to do. I try to run apache cordova through aptana using Ripple and Android Emulator
I am using aptana studio 3 for web development IDE and I try to configure it in order to develop phonegap apps. I have OS Windows 8.1 64
I have Java sdk
I installed Android sdk
I have Node JS
I have the cordova phonegap using npm install -g cordova in the C
I have installed Ripple emulator as plugin in Chrome. In order to run it through aptana I go to the run arrow and I select Run Configurations and making a new configuration using in
Browser Executable: the path for chrome.exe
Arguments: --enable-extensions --allow-file-access-from-files
And run it.
Also I go to Help --> Install New Software in order to take the android developer tools. I click in the right up corner the button Add and I give the name ADT and location https://dl-ssl.google.com/android/eclipse/
Everything work. I tried to insert an existing phonegap project and run it but I have a problem to show the android emulator. Any help how can I do it?
Also any help how I will run a new phonegap example in order to make my own app and test it with Ripple and Android Emulator? Also can I install plugins like org.apache.cordova.splashscreen

Categories

Resources