So I have a react-native app and it works fine in my simulat in computer, but when I want to check it in real device I get errors..
1.I run react-native run-android (app installs to real device, with just giving warning about adb reverse, cuz device's android version is 4.4.2)
2.When app opens in real device, says "Unable to load script from assets etc."
3.Then I try to open Dev Settings to connect to bundle via wifi as suggested and My app crashes!.. I tried in 2 different devices it crashed in both.
I tracked it with android device monitor and I get some errors starting with :
07-18 17:03:24.596: E/AndroidRuntime(1160): android.view.InflateException: Binary XML file line #19: Error inflating class android.widget.CheckBox 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.createView(LayoutInflater.java:626) 07-18 17:03:24.596: E/AndroidRuntime(1160): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:675) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:700) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.inflate(LayoutInflater.java:470) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.inflate(LayoutInflater.java:398) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.LayoutInflater.inflate(LayoutInflater.java:354) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.preference.Preference.onCreateView(Preference.java:531) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.preference.Preference.getView(Preference.java:494) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.preference.PreferenceGroupAdapter.getView(PreferenceGroupAdapter.java:222) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.AbsListView.obtainView(AbsListView.java:2742) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.ListView.makeAndAddView(ListView.java:1811) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.ListView.fillDown(ListView.java:697) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.ListView.fillFromTop(ListView.java:763) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.ListView.layoutChildren(ListView.java:1641) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.AbsListView.onLayout(AbsListView.java:2567) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1666) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.onLayout(LinearLayout.java:1442) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.FrameLayout.onLayout(FrameLayout.java:388) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.LinearLayout.onLayout(LinearLayout.java:1440) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.widget.FrameLayout.onLayout(FrameLayout.java:388) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.View.layout(View.java:15819) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewGroup.layout(ViewGroup.java:4884) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2391) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2099) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1270) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6721) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:812) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.Choreographer.doCallbacks(Choreographer.java:612) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.Choreographer.doFrame(Choreographer.java:582) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:798) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.os.Handler.handleCallback(Handler.java:733) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.os.Handler.dispatchMessage(Handler.java:95) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.os.Looper.loop(Looper.java:146) 07-18 17:03:24.596: E/AndroidRuntime(1160): at android.app.ActivityThread.main(ActivityThread.java:5641) 07-18 17:03:24.596: E/AndroidRuntime(1160): at java.lang.reflect.Method.invokeNative(Native Method) 07-18 17:03:24.596: E/AndroidRuntime(1160): at java.lang.reflect.Method.invoke(Method.java:515) 07-18 17:03:24.596: E/AndroidRuntime(1160): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1288) 07-18 17:03:24.596: E/AndroidRuntime(1160): at com.android.internal.os.Zygote 07-18 17:03:24.656: A/libc(1215): Fatal signal 13 (SIGPIPE) at 0x000004bf (code=0), thread 1215 (uptime)
Any ideas how I can solve this..?
app/android/app/build.gradle :
apply plugin: "com.android.application"
import com.android.build.OutputFile
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.gotl"
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-track-player')
compile project(':react-native-sound-player')
compile project(':react-native-sound')
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.facebook.fresco:animated-gif:1.3.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'
}
I want to share that I noticed it crashes in android 4.4.4 version, but its not crashing in 5.0 version.. So anyone have some idea about it?..
User contributions licensed under CC BY-SA 3.0