標籤: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 開發常見問題