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

We have the light

然后对门徒说:"我们再往犹太去吧。" (约翰福音 11:7 和合本)
and then he said to his disciples, "Let us go back to Judea." (John 11:7 NIV)
门徒说:"拉比,犹太人近来要拿石头打你,你还往那里去吗?" (约翰福音 11:8 和合本)
"But Rabbi," they said, "a short while ago the Jews there tried to stone you, and yet you are going back?" (John 11:8 NIV)
耶稣回答说:"白日不是有十二小时吗?人在白日走路,就不至跌倒,因为看见这世上的光。 (约翰福音 11:9 和合本)
Jesus answered, "Are there not twelve hours of daylight? Anyone who walks in the daytime will not stumble, for they see by this world's light. (John 11:9 NIV)
若在黑夜走路,就必跌倒,因为他没有光。" (约翰福音 11:10 和合本)
It is when a person walks at night that they stumble, for they have no light." (John 11:10 NIV)


Photo by Wes Hicks / Unsplash

react-native run-android : do not build/update modified code(App.js)

Solution

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res 

c:\Users\lenger\Desktop\webrowser>react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
Scanning folders for symlinks in c:\Users\lenger\Desktop\webrowser\node_modules (43ms)
Scanning folders for symlinks in c:\Users\lenger\Desktop\webrowser\node_modules (38ms)
Loading dependency graph, done.
bundle: start
bundle: finish
bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle
bundle: Done writing bundle output

Run react-native run-android again, you will find your modification work.

react-native run-android : Could not find com.android.tools.build:gradle:3.0.1

Could not resolve all files for configuration ':classpath'.
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :

Solution

Add google() inside buildscript() and Sync Project.
gradle-issues

react-native run-android : buildToolsVersion "23.0.1" is ignored

c:\Users\lenger\Desktop\webrowser>git diff android/build.gradle

diff --git a/android/build.gradle b/android/build.gradle index eed9972..c5fecab 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,7 +5,7 @@ buildscript {          jcenter()      }      dependencies { -        classpath 'com.android.tools.build:gradle:2.2.3' +        classpath 'com.android.tools.build:gradle:3.0.1'           // NOTE: Do not place your application dependencies here; they belong          // in the individual module build.gradle files 

warning

c:\Users\lenger\Desktop\webrowser>git diff android/app/build.gradle

diff --git a/android/app/build.gradle b/android/app/build.gradle index b589c49..b20457c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -95,7 +95,6 @@ def enableProguardInReleaseBuilds = false   android {      compileSdkVersion 23 -    buildToolsVersion "23.0.1"       defaultConfig {          applicationId "com.webrowser" 

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...