Build Failed Generated Build APK react native - android

I Want generated build apk but after cd android && ./gradlew assembleRelease build failed.
there my info:
* What went wrong:
Could not list contents of '/Users/sweet/Desktop/phase/ka-
mobile/node_modules/react-native/third-party/glog-0.3.4/test-driver'.
Couldn't follow symbolic link.
i already put my-release-key.keystore under android/app
and change android/app/build.gradle
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.kickavenue"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
and change android/gradle.properties or change on ~/.gradle/gradle.properties
android.useDeprecatedNdk=true //only on android/gradle.properties i write
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=sample
MYAPP_RELEASE_KEY_PASSWORD=sample
there is wrong my step to build genereated APK

What version of RN are you using? This issue appears on RN 0.46.3 as stated on React Native's github: https://github.com/facebook/react-native/issues/14464
You could upgrade to React Native 0.47.0 to fix the issue.

Try deleting the .bin folder inside your node_modules

Related

Flutter Release apk won't run or open on android devices

I have built a release android apk file, conceived for a size of 7.9 MB.
I manage to install it on my android device, but not to open it because it crashes.
When i use flutter run --release it still does not open and detects no errors.
How can I solve that problem?
Thank you for your help.
Note: I have found several questions close to mine, but they have an error or are not entirely similar to mine. As a consequence the solution given do not work on my case.
Here is some of my build.gradle
android {
compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.misteref.mykamus"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
in app level build.gradle
set minifyEnabled and shrinkResources to false
or use progaurd if you need this two be true
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
To expand on #Joachim Haglund's comment
update your gradle file with the following. All the builds will then be included in the aab file. (It's also worth checking what SDKs you have installed/require updating with Android Studio)
android {
defaultConfig {
//add the following
ndk {
abiFilters "x86", "x86_64", "armeabi", "armeabi-v7a", "arm64-v8a"
}
}
}

Cannot generate apk in release mode

I was following this documentation "Configure the build process to automatically sign your app" https://developer.android.com/studio/publish/app-signing#sign-auto and trying to generate apk for release version.
However, the apk that is generated always locate inside debug folder even though I did setting for release on Module Setting.
This is gradle file.
android {
signingConfigs {
config {
keyAlias 'key0'
keyPassword 'password'
storeFile file('C:/path/to/filename.jks')
storePassword 'password'
}
}
compileSdkVersion 28
defaultConfig {
applicationId "com.packagename"
minSdkVersion 19
targetSdkVersion 28
versionCode 3
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
}
and I clicked Build Bundle(s)/APK(s) -> Build APK(s)
Is this what it supposed to do? If not, how can I fix this?
In android studio click on Build variant option on left vertical bar and then select release Build variant then Build Bundle(s)/APK(s) -> Build APK(s)

React-Native Release APK crashes

I have a react-native app that runs with the react-native run-android command, but when I try to build the signed apk for release, the app crashes on some devices. Here is my build gradle:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.mednetinternal"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "arm64-v8a"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk true // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a":3]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
I tried methods that other strings related to the same or similar questions mentioned, but nothing has worked. Upon extracting the universal apk, I found libimagepipeline.so as the only file in /lib/arm64-v8a, but adding an exclude statement for it in packagingOptions did not work either. Is there some way to make an apk that works on all devices?
The errors I have been getting are:
libgnustl_shared.so is 32-bit instead of 64-bit.
Could not find libreactnativejni.so

React Native installRelease Task 'installRelease' not found in root project 'timeReportTool'. Some candidates are: 'uninstallRelease'

Okay so I am trying to get my react-native into an apk file and install it on a device the assembleRelease works fine but it seems like it doesn't get the signing since I can only install the debug version and not installRelease which gives me the error
Task 'installRelease' not found in root project 'timeReportTool'. Some candidates are: 'uninstallRelease'.
here is the Android block from my build.gradle
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.timereporttool"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release // add this line as well
}
}...
I do get an app-release-unsigned.apk so it is clearly not getting signed in Android studios it can't sync the gradle because of this line that were there from the start
apply from: "../../node_modules/react-native/react.gradle"
in Android Studio the node modules map is empty but it exists in the directory
You have to create a signing key and reference it in your project, as described here: https://facebook.github.io/react-native/docs/signed-apk-android
It's crazy that no one answered this for over a year. There's no way around this issue if you publish a React-Native app to the Play Store.
It's due to unsigned code. You have to follow some sort of steps mentioned in the react native official website for generating a signed apk. Otherwise, even though the apk is created, the user not able to install it on their device.
Refer the following link for generating signed apk.
Publishing to Google Play Store

Android studio- adding signing configurations to gradle

I am very new to the android world and I was trying to just get to run a simple hello world app on my phone.
when I tried this I learnt that the APK generated by an android studio is an unsigned one. So to sign this I have gone through the process of creating a Key store and then a private Key, its alias and I was successful in signing the APK and installing on my phone and running it too.
Then I went through this link for adding signing configurations to the gradle to automatically sign the release with the newly created key store file.
I have followed the steps n the above link properly and did not miss anything but still when I finish my signing configurations I have an error saying
Gradle project sync failed.Basic functionality(eg. editing, debugging)
will not work properly.
Error:(19, 0) Could not find property 'config' on SigningConfig
container.
I was taken by a surprise! and now I am not able to sign my APKs manually too.
Now when I try to sign manually, it says the gradle is not in sync
I guess this file will be of help to help me solve this error. build.gradle of the project. I am trying to understand is what is mentioned here is same as the one I configured through the Android Studio UI while making the signing configurations.
apply plugin: 'com.android.application'
android {
signingConfigs {
release {
storeFile file("<path>\\firstKeystore.jks")
storePassword "******"
keyAlias "usual password"
keyPassword "******"
}
}
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
applicationId 'com.tech.vasanth.newsfeed'
minSdkVersion 19
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
debuggable false
jniDebugBuild false
renderscriptDebugBuild false
zipAlign true
}
debug {
signingConfig signingConfigs.config
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
There is a mistake in the buildTypes.release block. The signing config should be:
signingConfig signingConfigs.release
Note, that this is how you named the configuration in the signingConfigs block above.
Also leave out the signing config in the buildTypes.debug block (or, if you really want to have it, set it like above).
I have been using below configurations for Debug/Release.
signingConfigs {
release {
keyAlias 'keyAlias'
keyPassword 'keyPassword'
storePassword 'storePassword'
storeFile file("${rootDir}/keystores/app.keystore")
}
debug {
storeFile file("${rootDir}/keystores/debug.keystore")
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
}
}
While defining a release module:
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'other-rules.pro'
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.debug
}
}
Note: Here rootDir is your project root directory. Please store your keystore in mentioned directory.
structure of get a release is like this :
signingConfigs {
release {
storeFile file("release.keystore")
storePassword "******"
keyAlias "******"
keyPassword "******"
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}

Categories

Resources