android 開發常見問題

來源:互聯網
上載者:User

標籤:jpg   目的   分享圖片   tput   modules   方法   lse   ORC   for   

 

 

指定版本 就OK了  

路徑: android/app/build.gradle
compile ("com.facebook.react:react-native:填你自己的RN版本") { force = true }

 

這個問題看你的 rn 版本了 新版本 沒有 index.android.js  舊的有這個
舊版本解決方案

1.首先手動在main下建立一個assets檔案夾
2.然後cmd 進入項目的根目錄下執行:

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

3.在執行 react-native run-android;

新的版本

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/

 

注意了,新版本是編譯index.js而不是index.android.js,因為react-native新版本已經沒有index.android.js和index.ios.js兩個檔案了,只有一個index.js檔案,所以要編譯index.js 
會發現 assets檔案夾下多出兩個檔案 

 index.android.bundle index.android.bundle.meta

this._lazyCallableModules[e] is not a function. (In ‘this._lazyCallableModules[e]()‘, ‘this._lazyCallableModules[e]‘ is undefined)

用Xcode 開啟工程 搜尋 RCTRootView  進入.m 檔案

搜尋  [selfbundleFinishedLoading:([_bridgebatchedBridge] ?:_bridge)];

改成

if(!_bridge.loading)

{

[selfbundleFinishedLoading:([_bridgebatchedBridge] ?:_bridge)];

}

 

android 開發常見問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.