React Native mobile terminal development miscellanea

no packager (error code 101)

More complete error message is as follows: error (error code 101) --no-packager when run-android
If the application code itself is not a serious problem, VSCode debugging this error does not make sense when you can use the following command line in the Node window command to resolve:

// 已经定位到工程目录下
cd android
gradlew clean 

The second line will be used to build a command to clear the file directory under the android folder
reference links

Execution failed for task ‘:app:transformDexArchiveWithDexMergerForDebug’.

Complete the following error message:

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

Error Cause: There are more than 64K of methods (including dependencies) application
solutions

JS how an array in reverse order

Application development has similar timeline function, if history is not too easy to find the required reverse order, the UI component objects of an array in reverse order to, where two recording methods:

array.unshift(插入到数组开头的元素)  // 与push()相对应
array.reverse()	  // 将数组中已有的元素逆序排列

You can refer to this blog

How to determine the object is not a string

typeof(obj) == 'string'

for in and for of difference

for in // 迭代数组或对象的索引
for of // 迭代数组的内容

If you use for objects of error.

JS deep copy on the object

The following method is a deep copy take-all solution may be nested deep copy of the object.

JSON.parse(JSON.stringify(obj))

About absolute position of the component

Required component is set to an absolute position, if you want it displayed in the upper other existing components, then it should be written on the back of existing components.

<View>
	<其他组件>
	...
	</ 其他组件>
	<绝对位置组件 style={{position: 'absolute'}}>
	</ 绝对位置组件>
</ View>
Released two original articles · won praise 0 · Views 99

Guess you like

Origin blog.csdn.net/Cui_Hongwei/article/details/103828261