[英]android build fails with error - null is not an object
我有一個私人 gitlab 存儲庫(反應本機模塊),我將此存儲庫添加到我的應用程序的 package.json。
我的私人 gitlab 存儲庫中的索引文件:
ios 方法:
android方法:
現在在我的應用程序中,我安裝了上述模塊並調用了方法。
應用程序.js
在 ios 中,一切正常。
“乘法” (HealthLibrary.multiply()]和“requestAuthorization” [HealthLibrary.requestAuthorization()]都可以正常工作。
但是當我運行“react-native run-android”時,構建成功但顯示為空白屏幕,日志中有此錯誤
TypeError: null is not an object (evaluating 'nativeModule.requestAuthorization')
Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
為什么只有在我運行 android 時才會彈出此錯誤??我什至沒有調用“requestAuthorization”方法,但我無法在 Android 中構建應用程序。
任何幫助都會很棒的家伙....
在您提供的圖像中,您的 android 文件中似乎沒有requestAuthorization
方法,只有一個名為“getAuthorization”的方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.