npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE

F:\webrowser>npm install -g react-native-cli
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/react-native-cli failed, reason:
unable to verify the first certificate

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-01-11T1
6_55_54_266Z-debug.log

solution

npm config set strict-ssl false

F:\webrowser>npm install -g react-native-cli
C:\Users\Administrator\AppData\Roaming\npm\react-native -> C:\Users\Administrato
r\AppData\Roaming\npm\node_modules\react-native-cli\index.js

  • react-native-cli@2.0.1
    added 41 packages in 23.687s

git clone : SSL cert ificate problem: unable to get local issuer certificate

F:>git clone https://github.com/lengerrong/webrowser.git
Cloning into 'webrowser'...
fatal: unable to access 'https://github.com/lengerrong/webrowser.git/': SSL cert
ificate problem: unable to get local issuer certificate

F:>git config --global http.sslVerify false

F:>git clone https://github.com/lengerrong/webrowser.git
Cloning into 'webrowser'...
remote: Counting objects: 134, done.
remote: Compressing objects: 100% (90/90), done.
Receiving objects: 33% (45/134), 492.00 KiB | 17.00 KiB/s

Generate Signed android APK for react-native app

Refer:
https://facebook.github.io/react-native/docs/signed-apk-android.html

create your own key store file

https://errong.win/generate-keystore/

modifications

signed-apk

error INSTALL_FAILED_UPDATE_INCOMPATIBLE

https://errong.win/react-native-run-android-variant-release/

java.lang.NullPointerException (no error message)

When I set below values to true, I encountered NullPointerException.
so my reset them to false again.

+ def enableSeparateBuildPerCPUArchitecture = true + universalApk true  // If true, also generate a universal APK + def enableProguardInReleaseBuilds = true 

error can't delete/read lint-results-release-fatal.html

kill all java.exe via task manager

set up proxy for android emulator

c:\Users\lenger\AppData\Local\Android\Sdk\tools>emulator.exe -http-proxy ip:port -avd Nexus_5X_API_23

c:\Users\lenger\AppData\Local\Android\Sdk\tools>bin\avdmanager.bat list avd

    Name: Nexus_5X_API_23   Device: Nexus 5X (Google)     Path: C:\Users\lenger\.android\avd\Nexus_5X_API_23.avd   Target: Google APIs (Google Inc.)           Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/x86_64     Skin: nexus_5x   Sdcard: 100M ---------     Name: Nexus_5X_API_23_2   Device: Nexus 5X (Google)     Path: C:\Users\lenger\.android\avd\Nexus_5X_API_23_2.avd   Target: Google APIs (Google Inc.)           Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/armeabi-v7a     Skin: nexus_5x   Sdcard: 100M ---------     Name: Nexus_5X_API_27_x86   Device: Nexus 5X (Google)     Path: C:\Users\lenger\.android\avd\Nexus_5X_API_27_x86.avd   Target: Google APIs (Google Inc.)           Based on: Android API 27 Tag/ABI: google_apis/x86     Skin: nexus_5x   Sdcard: 800M Snapshot: no 

react-native run-android --variant=release INSTALL_FAILED_UPDATE_INCOMPATIBLE

Task :app:installRelease
Installing APK 'app-release.apk' on 'Nexus_5X_API_23(AVD) - 6.0' for app:release
Unable to install C:\Users\lenger\Desktop\webrowser\android\app\build\outputs\apk\release\app-release.apk
com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE
at com.android.ddmlib.Device.installRemotePackage(Device.java:1004)
at com.android.ddmlib.Device.installPackage(Device.java:911)
at com.android.builder.testing.ConnectedDevice.installPackage(ConnectedDevice.java:122)
at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:171)
at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:105)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:731)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:705)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:installRelease'.

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE

Cause

the application which you want to install is already installed.

Solution

uninstall the old one and try again.
adb uninstall xxx

vim : remove ^M

1

vim下 :%s/^M//g 或者 :1,$s/^M//g 均可
补充一点:
^M是使用 "CTRL-V CTRL-M" 而不是字面上的 ^M

2

:set ff=unix

3

dos2unix || unix2dos

Install wechat for Android Emulator

down load wechat apk

https://apps.evozi.com/apk-downloader/?id=com.tencent.mm
wechat.apk

copy apk to

C:\Users\lenger\AppData\Local\Android\Sdk\platform-tools>

install via adb.exe

1 start a emulator
2 cmd.exe
cd C:\Users\lenger\AppData\Local\Android\Sdk\platform-tools>
adb.exe install com.tencent.mm.apk
com.tencent.mm.apk: 1 file pushed. 60.5 MB/s (42637973 bytes in 0.672s)
pkg: /data/local/tmp/com.tencent.mm.apk
Failure [INSTALL_FAILED_NO_MATCHING_ABIS]

It seems like we should use a armv7 emulator, but that has 10x slower on x86 host.
armeabi

adb.exe devices
adb.exe -s emulator install xxx.apk

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...