facebook twitter hatena line email

「Javascript/reactnative/helloworld/react-native-cli」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(実行)
行18: 行18:
 
</pre>
 
</pre>
  
===実行===
+
===Android実行===
 
  cd hello
 
  cd hello
 
  react-native run-android # android
 
  react-native run-android # android
 
  react-native run-ios # ios
 
  react-native run-ios # ios
====Android実行====
+
 
=====removed in Gradle 7.0削除エラー=====
+
====removed in Gradle 7.0削除エラー====
 
以下エラーが出て失敗。
 
以下エラーが出て失敗。
 
  Internal API constructor DefaultDomainObjectSet(Class<T>) has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use ObjectFactory.domainObjectSet(Class<T>) instead.
 
  Internal API constructor DefaultDomainObjectSet(Class<T>) has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use ObjectFactory.domainObjectSet(Class<T>) instead.
行29: 行29:
 
 
  
=====端末表示失敗=====
+
====端末表示失敗====
 
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
 
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
  
行36: 行36:
  
 
参考:https://github.com/facebook/react-native/issues/29396
 
参考:https://github.com/facebook/react-native/issues/29396
 +
 +
===ios実行===
 +
cd hello
 +
react-native run-ios # ios
  
 
===参考===
 
===参考===
 
https://snova301.hatenablog.com/entry/2019/05/05/231232
 
https://snova301.hatenablog.com/entry/2019/05/05/231232

2020年7月17日 (金) 17:37時点における版

react-native-cliを使ったhelloworld

$ react-native init hello

以下構成で作成される

App.js
__tests__ [dir]
android [dir]
app.json
babel.config.js
index.js
ios [dir]
metro.config.js
node_modules [dir]
package.json
yarn.lock

Android実行

cd hello
react-native run-android # android
react-native run-ios # ios

removed in Gradle 7.0削除エラー

以下エラーが出て失敗。

Internal API constructor DefaultDomainObjectSet(Class<T>) has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use ObjectFactory.domainObjectSet(Class<T>) instead.

端末表示失敗

warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.

react-nativeを0.59から0.62に上げると、このエラーになったとの情報があるので、react-native本体バージョンを指定して作成し直す。

react-native init hello59 --version 0.59

参考:https://github.com/facebook/react-native/issues/29396

ios実行

cd hello
react-native run-ios # ios

参考

https://snova301.hatenablog.com/entry/2019/05/05/231232