linearGradientProps crashes my app - react-native

What can I do about it? I can't use the code that should work:
<Button
text="SIGNUP"
ViewComponent={require('react-native-linear-gradient').LinearGradient}
linearGradientProps={{
colors: ['red', 'pink', 'red'],
}}
/>
I get this annoyance:
console.error: "You need to pass a ViewComponent to use linearGradientProps !
Example: ViewComponent={require('react-native-linear-gradient')}"
error
index.delta?platform=android&dev=true&minify=false:53482:18
componentDidMount
index.delta?platform=android&dev=true&minify=false:75816:24
proxiedComponentDidMount
index.delta?platform=android&dev=true&minify=false:35849:47
commitLifeCycles
index.delta?platform=android&dev=true&minify=false:9162:47
commitAllLifeCycles
index.delta?platform=android&dev=true&minify=false:10328:31
invokeGuardedCallback
index.delta?platform=android&dev=true&minify=false:2741:21
invokeGuardedCallback
index.delta?platform=android&dev=true&minify=false:2810:40
commitRoot
index.delta?platform=android&dev=true&minify=false:10408:38
completeRoot
index.delta?platform=android&dev=true&minify=false:11329:52
performWorkOnRoot
index.delta?platform=android&dev=true&minify=false:11286:29
performWork
index.delta?platform=android&dev=true&minify=false:11219:32
performSyncWork
index.delta?platform=android&dev=true&minify=false:11200:22
requestWork
index.delta?platform=android&dev=true&minify=false:11127:28
scheduleWorkImpl
index.delta?platform=android&dev=true&minify=false:11000:28
scheduleWork
index.delta?platform=android&dev=true&minify=false:10960:34
enqueueSetState
index.delta?platform=android&dev=true&minify=false:6796:25
setState
index.delta?platform=android&dev=true&minify=false:23663:37
dispatch
index.delta?platform=android&dev=true&minify=false:63019:27
navigate
index.delta?platform=android&dev=true&minify=false:63414:37
_handlePageChanged
index.delta?platform=android&dev=true&minify=false:70273:28
_jumpToIndex
index.delta?platform=android&dev=true&minify=false:70760:35
_handleOnPress
index.delta?platform=android&dev=true&minify=false:72995:22
_handleTabPress
index.delta?platform=android&dev=true&minify=false:72256:32
onPress
index.delta?platform=android&dev=true&minify=false:72058:52
_callTimer
index.delta?platform=android&dev=true&minify=false:15395:17
callTimers
index.delta?platform=android&dev=true&minify=false:15600:19
__callFunction
index.delta?platform=android&dev=true&minify=false:2368:49
<unknown>
index.delta?platform=android&dev=true&minify=false:2138:31
__guardSafe
index.delta?platform=android&dev=true&minify=false:2330:13
callFunctionReturnFlushedQueue
index.delta?platform=android&dev=true&minify=false:2137:21
It seems to be the same issue as this one https://github.com/react-native-training/react-native-elements/issues/873
my settings.gradle
rootProject.name = 'koolbusiness'
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':#remobile/react-native-splashscreen'
project(':#remobile/react-native-splashscreen').projectDir = new File(rootProject.projectDir, '../node_modules/#remobile/react-native-splashscreen/android')
include ':app'
my app/build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.koolbusiness"
minSdkVersion 16
targetSdkVersion 22
versionCode 56
versionName "0.0.56a"
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
}
}
// 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]
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
}
}
}
}
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-image-picker')
compile project(':react-native-share')
compile project(':react-native-linear-gradient')
compile project(':react-native-vector-icons')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
With RNE beta2 instead of beta3 the error message is:
ViewManager: Error while updating prop end
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:107)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.ClassCastException: com.facebook.react.bridge.ReadableNativeArray cannot be cast to java.lang.Double
at com.facebook.react.bridge.ReadableNativeMap.getDouble(ReadableNativeMap.java:148)
at com.facebook.react.bridge.DynamicFromMap.asDouble(DynamicFromMap.java:66)
at com.facebook.react.uimanager.LayoutShadowNode$MutableYogaValue.setFromDynamic(LayoutShadowNode.java:57)
at com.facebook.react.uimanager.LayoutShadowNode.setPositionValues(LayoutShadowNode.java:672)
at java.lang.reflect.Method.invoke(Native Method) 
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:107) 
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154) 
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58) 
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298) 
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289) 
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374) 
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162) 
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:164) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194) 
at java.lang.Thread.run(Thread.java:764) 
03-29 16:18:49.640 10793-10822/com.koolbusiness E/unknown:ReactNative: Exception in native call
com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'end' in shadow node of type: RCTView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:113)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58)
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298)
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289)
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:107)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154) 
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58) 
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298) 
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289) 
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374) 
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162) 
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:164) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194) 
at java.lang.Thread.run(Thread.java:764) 
Caused by: java.lang.ClassCastException: com.facebook.react.bridge.ReadableNativeArray cannot be cast to java.lang.Double
at com.facebook.react.bridge.ReadableNativeMap.getDouble(ReadableNativeMap.java:148)
at com.facebook.react.bridge.DynamicFromMap.asDouble(DynamicFromMap.java:66)
at com.facebook.react.uimanager.LayoutShadowNode$MutableYogaValue.setFromDynamic(LayoutShadowNode.java:57)
at com.facebook.react.uimanager.LayoutShadowNode.setPositionValues(LayoutShadowNode.java:672)
at java.lang.reflect.Method.invoke(Native Method) 
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateShadowNodeProp(ViewManagersPropertyCache.java:107) 
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackShadowNodeSetter.setProperty(ViewManagerPropertyUpdater.java:154) 
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:58) 
at com.facebook.react.uimanager.ReactShadowNodeImpl.updateProperties(ReactShadowNodeImpl.java:298) 
at com.facebook.react.uimanager.UIImplementation.createView(UIImplementation.java:289) 
at com.facebook.react.uimanager.UIManagerModule.createView(UIManagerModule.java:364) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:374) 
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:162) 
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
at android.os.Handler.handleCallback(Handler.java:790) 
at android.os.Handler.dispatchMessage(Handler.java:99) 
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31) 
at android.os.Looper.loop(Looper.java:164) 
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:194) 
at java.lang.Thread.run(Thread.java:764) 
03-29 16:18:49.711 10793-10793/com.koolbusiness D/ReactNative: CatalystInstanceImpl.destroy() start

You need to use require('react-native-linear-gradient').default.
I've updated the example on Github, my bad.
Try this instead (with RNE v1.0.0-beta3):
<Button
title="SIGNUP"
ViewComponent={require('react-native-linear-gradient').default}
linearGradientProps={{
colors: ['#FF9800', '#F44336'],
start: [1, 0],
end: [0.2, 0],
}}
/>
This should give you this result

Give something like this a try? this is their documented example on their github
import LinearGradient from 'react-native-linear-gradient';
// Within your render function
<LinearGradient colors={['#4c669f', '#3b5998', '#192f6a']} style={styles.linearGradient}>
<Text style={styles.buttonText}>
Sign in with Facebook
</Text>
</LinearGradient>
// Later on in your styles..
var styles = StyleSheet.create({
linearGradient: {
flex: 1,
paddingLeft: 15,
paddingRight: 15,
borderRadius: 5
},
buttonText: {
fontSize: 18,
fontFamily: 'Gill Sans',
textAlign: 'center',
margin: 10,
color: '#ffffff',
backgroundColor: 'transparent',
},
});

Related

React native app with Hermes crashes with "SIGSEGV: Segmentation violation (invalid memory reference) "

In our crash tracking app bugsnag, I see an increasing amount of crashes with "SIGSEGV: Segmentation violation (invalid memory reference)". They seem to happen only on Android and the stacktrace is full of libhermes.so.
This stacktraces tells me nothing and I haven't found any existing questions with the same problem. Does anyone have an idea where to look for the root cause for this? Is it a javascript error that hermes turns into a SIGSEGV? A bug in hermes? A crash in one of the libraries we use?
Stacktrace from one of the crashes.
SIGSEGV Segmentation violation (invalid memory reference)
/data/app/com.wolt.courierapp-poHmOlYLJ3-nWo0m_w4kVw==/lib/arm64/libhermes.so:116080 facebook::hermes::detail::hermesFatalErrorHandler(void*, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, bool)
/data/app/.../lib/arm64/libhermes.so:1222852 0x701af048c4
/data/app/.../lib/arm64/libhermes.so:1222588 0x701af047bc
/data/app/.../lib/arm64/libhermes.so:1056428 0x701aedbeac
/data/app/.../lib/arm64/libhermes.so:182328 0x701ae06838
/data/app/.../lib/arm64/libhermes.so:523104 0x701ae59b60
/data/app/.../lib/arm64/libhermes.so:298092 0x701ae22c6c
/data/app/.../lib/arm64/libhermes.so:564832 0x701ae63e60
/data/app/.../lib/arm64/libhermes.so:216036 0x701ae0ebe4
/data/app/.../lib/arm64/libhermes.so:568480 0x701ae64ca0
/data/app/.../lib/arm64/libhermes.so:578128 0x701ae67250
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:539976 0x701ae5dd48
/data/app/.../lib/arm64/libhermes.so:662544 0x701ae7bc10
/data/app/.../lib/arm64/libhermes.so:723864 0x701ae8ab98
/data/app/.../lib/arm64/libhermes.so:724172 0x701ae8accc
/data/app/.../lib/arm64/libhermes.so:724136 0x701ae8aca8
/data/app/.../lib/arm64/libhermes.so:645300 0x701ae778b4
/data/app/.../lib/arm64/libhermes.so:543328 0x701ae5ea60
/data/app/.../lib/arm64/libhermes.so:581332 0x701ae67ed4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:581364 0x701ae67ef4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:581364 0x701ae67ef4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:581364 0x701ae67ef4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:413044 0x701ae3ed74
/data/app/.../lib/arm64/libhermes.so:543328 0x701ae5ea60
/data/app/.../lib/arm64/libhermes.so:581332 0x701ae67ed4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:413044 0x701ae3ed74
/data/app/.../lib/arm64/libhermes.so:543328 0x701ae5ea60
/data/app/.../lib/arm64/libhermes.so:581332 0x701ae67ed4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:581364 0x701ae67ef4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:581364 0x701ae67ef4
/data/app/.../lib/arm64/libhermes.so:544160 0x701ae5eda0
/data/app/.../lib/arm64/libhermes.so:541776 0x701ae5e450
/data/app/.../lib/arm64/libhermes.so:147152 facebook::hermes::HermesRuntimeImpl::call(facebook::jsi::Function const&, facebook::jsi::Value const&, facebook::jsi::Value const*, unsigned long)
/data/app/.../lib/arm64/libhermes-executor-release.so:173936 facebook::jsi::Value facebook::jsi::Function::call<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value>(facebook::jsi::Runtime&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, facebook::jsi::Value&&) const
/data/app/.../lib/arm64/libhermes-executor-release.so:173516 0x701a4765cc
/data/app/.../lib/arm64/libhermes-executor-release.so:154820 void std::__ndk1::__invoke_void_return_wrapper<void>::__call<void (*&)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>), std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()> >(void (*&)(std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>), std::__ndk1::function<void ()> const&, std::__ndk1::function<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > ()>&&)
/data/app/.../lib/arm64/libhermes-executor-release.so:164992 facebook::react::JSIExecutor::callFunction(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, folly::dynamic const&)
/data/app/.../lib/arm64/libreactnativejni.so:683496 0x701a639de8
/data/app/.../lib/arm64/libreactnativejni.so:688656 0x701a63b210
/data/app/.../lib/arm64/libreactnativejni.so:439588 0x701a5fe524
/data/app/.../lib/arm64/libreactnativejni.so:372684 facebook::jni::detail::MethodWrapper<void (facebook::react::JNativeRunnable::*)(), &facebook::react::JNativeRunnable::run, facebook::react::JNativeRunnable, void>::dispatch(facebook::jni::alias_ref<facebook::jni::detail::JTypeFor<facebook::jni::HybridClass<facebook::react::JNativeRunnable, facebook::react::Runnable>::JavaPart, facebook::react::Runnable, void>::_javaobject*>)
/data/app/.../lib/arm64/libreactnativejni.so:372552
unknown 0x3850766e45494e4a```
Hermes is the a new JavaScript Engine for ReactNative you "can" use.
If you wan't to use it, you have to do some config-steps like described here: https://reactnative.dev/docs/hermes
You can check in your android/app/build.gradle file, if Hermes is enabled within your App.
If yes, be aware, that hermes does not support "android-bundles", but only apk-Packages.
Maybe (I only guessing) you had still activate hermes some time ago, but now switch over from APK to Android-Bundles.
BTW:
Did you use logcat to get your stacktrace? If not, please give it a try. It most of the time show error-messages you won't see in App-Stacktraces at the Device-Screen.
please try adding the hermes configs, like thisin app/build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = true
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* The preferred build flavor of JavaScriptCore.
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and mirrored here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.myapp.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk true // If true, also generate a universal APK
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://facebook.github.io/react-native/docs/signed-apk-android.
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.debug
def versionCodes = ["armeabi-v7a":1, "arm64-v8a":2, "x86":3, "x86_64": 4]
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
output.versionCodeOverride =
versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1000000 + android.defaultConfig.versionCode
}
}
}
}
// 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, "arm64-v8a":2, "x86":3, "x86_64": 4]
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
}
}
}
}
dependencies {
implementation project(':react-native-share')
implementation project(':react-native-view-shot')
implementation project(':react-native-gesture-handler')
implementation project(':react-native-orientation')
implementation project(':react-native-vector-icons')
implementation project(':react-native-charts-wrapper')
implementation project(':react-native-firebase')
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-messaging:18.0.0"
implementation project(':#react-native-community_async-storage')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
apply from: file("../../node_modules/#react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
and do npm install hermes-engine

Could not read script react.gradle as it does not exist

I'm new react native development i'm facing this error. react.gradle does not exist.
i want to run and make apk from android and then i want to upload to Google Play Store. am unable to understand why this error is happening although i have install npm on my macOS. but error still apears.
Thanks in advance
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.maac.doorkay"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
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
}
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
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, "x86_64": 4]
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
}
}
}
}
dependencies {
implementation project(':react-native-razorpay')
implementation project(':react-native-android-location-enabler')
implementation project(':react-native-firebase')
implementation project(':#react-native-community_async-storage')
implementation project(':react-native-snackbar')
implementation project(':react-native-image-picker')
implementation project(':react-native-fetch-blob')
implementation project(':react-native-vector-icons')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation "com.google.firebase:firebase-core:16.0.9"
implementation "com.google.firebase:firebase-messaging:18.0.0"
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'

Could not find com.google.firebase: when running react-native run-android

When running react-native run-android the command fails and I get the following error in my console.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.google.firebase:firebase-measurement-connector:12.0.1.
Required by:
project :app > com.google.firebase:firebase-messaging:15.0.2
> Could not find com.google.firebase:firebase-measurement-connector-impl:12.0.1.
Required by:
project :app > com.google.firebase:firebase-core:15.0.2
> Could not find com.google.android.gms:play-services-places-placereport:12.0.1.
Required by:
project :app > com.google.android.gms:play-services-location:15.0.1
> Could not find com.google.android.gms:play-services-measurement-base:12.0.1.
Required by:
project :app > com.google.firebase:firebase-analytics:15.0.2
> Could not find com.google.android.gms:play-services-stats:12.0.1.
Required by:
project :app > com.google.firebase:firebase-analytics:15.0.2
project :app > com.google.firebase:firebase-iid:15.1.0
> Could not find com.google.firebase:firebase-iid-interop:12.0.1.
Searched in the following locations:
- file:/Users/lexlemmens/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- file:/Users/lexlemmens/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- file:/Users/lexlemmens/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- file:/Users/lexlemmens/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- file:/Users/lexlemmens/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- file:/Users/lexlemmens/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- file:/Users/lexlemmens/.m2/repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- file:/Users/lexlemmens/.m2/repository/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- https://jcenter.bintray.com/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- https://jcenter.bintray.com/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
- file:/Users/lexlemmens/PhpstormProjects/easylog/mobile-app/node_modules/react-native/android/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.pom
- file:/Users/lexlemmens/PhpstormProjects/easylog/mobile-app/node_modules/react-native/android/com/google/firebase/firebase-iid-interop/12.0.1/firebase-iid-interop-12.0.1.aar
Required by:
project :app > com.google.firebase:firebase-iid:15.1.0
My android/build.gradle looks like this:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
versionCode = 15
versionName = "1.0.15"
}
repositories {
google()
jcenter()
}
dependencies {
// Required to use version 12.0.1 of com.google.android.*
classpath 'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
// https://github.com/evollu/react-native-fcm/issues/998
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '12.0.1'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '12.0.1'
}
}
}
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.10.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
And my app/build.gradle looks like this:
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: "com.android.application"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
/**
* ------------------------------------------
* ADD KEYSTORE PROPERTIES HERE
* ------------------------------------------
*/
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("keystores/com.centagon.easylog.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.centagon.android.easylog"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
keyAlias keystoreProperties['key.alias']
keyPassword keystoreProperties['key.alias.password']
storeFile file(keystoreProperties['key.store'])
storePassword keystoreProperties['key.store.password']
}
}
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]
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
}
}
}
}
dependencies {
compile project(':react-native-onesignal')
compile project(':amazon-cognito-identity-js')
compile project(':#aws-amplify_pushnotification')
compile project(':react-native-camera')
compile project(':react-native-config')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
I'm running react-native 0.57.2 and react-native-onesignal package 3.2.12.
Already moved the google() above the jcenter() as some people suggested but without luck. Someone who can help :)
You have not integrated Firebase in your project. As your dependencies in app/build.gradle should have firebase core and messaging also in MainApplication.java include new packages. And follow the complete installation guide here
https://rnfirebase.io/docs/v5.x.x/getting-started
Or if you are not using firebase packages then remove them from package.json and other import statements.
Then clean your project by cd android && ./gradlew clean.

React-native fbsdk build errors

I am getting the following errors while running the command react-native run-android or ./gradlew build
:react-native-fbsdk:generateReleaseResValues UP-TO-DATE
:react-native-fbsdk:generateReleaseResources
:react-native-fbsdk:mergeReleaseResources
:react-native-fbsdk:processReleaseManifest
:react-native-fbsdk:processReleaseResources
/Users/a/projects/gratisapp/node_modules/react-native-fbsdk/android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.3.1/res/values-v24/values-v24.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
/Users/a/projects/gratisapp/node_modules/react-native-fbsdk/android/build/intermediates/exploded-aar/com.android.support/appcompat-v7/25.3.1/res/values-v24/values-v24.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
:react-native-fbsdk:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-fbsdk:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/a/Library/Android/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.614 secs
Here is my app/build.gradle:
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.gratisapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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"
}
}
// 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]
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
}
}
}
}
dependencies {
compile project(':react-native-fbsdk')
compile project(':react-native-vector-icons')
compile project(':react-native-maps')
compile project(':react-native-i18n')
compile project(':react-native-device-info')
compile project(':react-native-config')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
// compile(project(':react-native-fbsdk')){
// exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
// }
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
// compile 'com.facebook.android:facebook-android-sdk:4.+'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.getRequested().getGroup() == 'com.google.android.gms') {
// If different projects require different versions of
// Google Play Services it causes a crash on run.
// Fix by overriding version for all projects.
details.useVersion('9.6.1')
}
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
I have also tried with compile('com.facebook.android:facebook-android-sdk:4.22.1') but it doesnt work.
I see that it is trying to get a resource from version 25.3.1, but why? And how do I fix this problem? Any suggestions regarding this?
Thanks
UPDATE
After the suggestion in the comments, here is my android/build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
project(':react-native-fbsdk') {
configurations.all {
resolutionStrategy {
force 'com.facebook.android:facebook-android-sdk:4.22.1'
}
}
}
and my app/build.gradle:
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.gratisapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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"
}
}
// 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]
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
}
}
}
}
dependencies {
compile project(':react-native-fbsdk')
compile project(':react-native-vector-icons')
compile project(':react-native-maps')
compile project(':react-native-i18n')
compile project(':react-native-device-info')
compile project(':react-native-config')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
// compile(project(':react-native-fbsdk')){
// exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
// }
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
// compile 'com.facebook.android:facebook-android-sdk:4.+'
// compile('com.facebook.android:facebook-android-sdk:4.22.1')
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
if (details.getRequested().getGroup() == 'com.google.android.gms') {
// If different projects require different versions of
// Google Play Services it causes a crash on run.
// Fix by overriding version for all projects.
details.useVersion('9.6.1')
}
}
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
And I get the error for running the comman `./gradlew clean build:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 25.0.3
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
UPDATE 2
So, after some suggestions given in the comments below, here is my android/app/build.gradle:
https://pastebin.com/q5qfHAug
and my android/build.gradle:
https://pastebin.com/GmckcqLb
and I am getting errors:
https://pastebin.com/JHe6XzzB
Make sure you've followed all of the steps in the Getting Started guide. Specifically, go to the "Getting Started with Native Code" tab and ensure you not only have all of the dependencies installed, but that you also have your environment variables set up correctly, i.e.:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
EDIT:
It looks like you may be missing a few imports, specifically:
import java.util.List;
import java.util.Arrays;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
I'm also not sure where MainReactPackage is coming from on line 29 of your MainActivity, but I assume it's a custom ReactPackage in your application, and you would need to import that as well.
In addition, you seem to be mixing code from what should be in your MainApplication.java file. The gitPackages() function you have defined should be moved there, as that function is defined in ReactApplication rather than ReactActivity.
EDIT 2:
Here is an example of what your MainActivity should look like:
package com.myapp;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
#Override
protected String getMainComponentName() {
return "myapp";
}
}
And this is what your MainApplication might look like:
package com.myapp;
import android.app.Application;
import android.util.Log;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import com.facebook.CallbackManager;
import com.facebook.FacebookSdk;
import com.facebook.reactnative.androidsdk.FBSDKPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
CallbackManager mCallbackManager;
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
#Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
#Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new FBSDKPackage(mCallbackManager)
);
}
};
#Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
#Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}

How can I install the Android Support Library in React Native?

I got this error:
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-billing'.
> Could not resolve all dependencies for configuration ':react-native-billing:_debugCompile'.
> Could not find com.android.support:appcompat-v7:25.3.1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
> Could not find com.android.support:recyclerview-v7:25.3.1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
> Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.
Searched in the following locations:
file:/C:/Users/xrobot/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar
Required by:
AwesomeProject:react-native-billing:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 35.786 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
So, I need the android support library. How can I install it ?
EDIT:
build.grade:
buildscript {
repositories {
jcenter()
}
dependencies {
// compile project(':react-native-billing')
classpath 'com.android.tools.build:gradle:1.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
app/build.gradle:
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.awesomeproject"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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"
}
}
// 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]
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
}
}
}
}
dependencies {
compile project(':react-native-billing')
compile project(':react-native-push-notification')
compile project(':react-native-sound')
compile project(':react-native-vector-icons')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile ('com.google.android.gms:play-services-gcm:8.1.0') {
force = true;
}
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
I had the same problem and i was able to fix it by doing what is referenced in this question (#roachman's answer).
Could not find com.android.support:appcompat-v7:25.3.1
I got this issue and I fixed it by downgrade react-native to version 0.55.4