Posts

react-native run-android : No connected devices!

Image
What went wrong: Execution failed for task ':app:installDebug'. com.android.builder.testing.api.DeviceException: No connected devices! Cause ADB driver is not ready Solution Install correct driver

Search the heart and Examine the mind

Image
我—耶和华是鉴察人心、试验人肺腑的,要照各人所行的和他作事的结果报应他。 (耶利米书 17:10 和合本) "I the Lord search the heart and examine the mind, to reward each person according to their conduct, according to what their deeds deserve." (Jeremiah 17:10 NIV) Photo by Max Bender / Unsplash

react-native run-android : sun.security.provider.cert path.SunCertPathBuilderException : unable to find valid certification path to req uested target

Image
F:\webrowser>react-native run-android Scanning folders for symlinks in F:\webrowser\node_modules (73ms) Starting JS server... Building and installing the app on the device (cd android && gradlew.bat install Debug)... Downloading https://services.gradle.org/distributions/gradle-4.1-all.zip Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.val idator.ValidatorException: PKIX path building failed: sun.security.provider.cert path.SunCertPathBuilderException: unable to find valid certification path to req uested target at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1959) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker. java:1514) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.jav a:216) at s...

error: package com.tencent.mm.sdk.openapi does not exist

Task :app:compileReleaseJavaWithJavac C:\Users\lenger\Desktop\webrowser\android\app\src\main\java\com\wx\react\WeChatModule.java:9: error: package com.tencent.mm.sdk.openapi does not exist import com.tencent.mm.sdk.openapi.IWXAPIEventHandler; ^ C:\Users\lenger\Desktop\webrowser\android\app\src\main\java\com\wx\react\WeChatModule.java:11: error: cannot find symbol public class WeChatModule extends ReactContextBaseJavaModule implements IWXAPIEventHandler { ^ symbol: class IWXAPIEventHandler 2 errors FAILURE: Build failed with an exception. solution com.tencent.mm.sdk ==> com.tencent.mm.opensdk

gradle build : Could not find method compile() for arguments

In build.gradle file add one of the following: dependencies { compile 'com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+' } What went wrong: A problem occurred evaluating root project 'webrowser'. Could not find method compile() for arguments [com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Cause edit wrong android/build.gradle Solution edit correct android/app/build.gradle.

install GNU tools via chocolatey for windows

Image
https://chocolatey.org/install @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(' https://chocolatey.org/install.ps1 '))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" choco install -y gnuwin32-coreutils.install choco install gnuwin32-grep.install -y choco install which -y choco install git -y choco install vim -y C:\Users\lenger>which rm C:\Program Files (x86)\GnuWin32\bin\rm.exe C:\Users\lenger>which which C:\ProgramData\chocolatey\bin\which.exe C:\Users\lenger>which ls C:\Program Files (x86)\GnuWin32\bin\ls.exe C:\Users\lenger>which grep C:\Program Files (x86)\GnuWin32\bin\grep.exe C:\Users\lenger>which mv C:\Program Files (x86)\GnuWin32\bin\mv.exe C:\Users\lenger>which mkdir C:\Program Files (x86)\GnuWin32\bin\mkdir.exe

react-native : communicate between react-native JS and WebView component

Image
APIs: window.postMessage in WebView , post a message to react-native JS . onMessage callback in react-native JS , receive a message from WebView . injectjavascript , Function that accepts a string that will be passed to the WebView and executed immediately as JavaScript. injectedjavascript , Set this to provide JavaScript that will be injected into the web page when the view loads. onMessage A function that is invoked when the webview calls window.postMessage. Setting this property will inject a postMessage global into your webview, but will still call pre-existing values of postMessage. window.postMessage accepts one argument, data, which will be available on the event object, event.nativeEvent.data. data must be a string. Sample code import React, { Component } from 'react'; import { Button, Platform, StyleSheet, Text, View, WebView, } from 'react-native'; var WEBVIEW_REF = 'webview'; export default class App extends Component<...