我对我的React本机应用程序进行了一些样式更改。一切在调试中看起来都不错,所以我尝试使用'react-native run-android --variant = release'运行发行版本,而调试中的任何更改均未显示。我确定自己没有疯,并删除了背景图片。发行版本完全没有变化。然后,我尝试生成签名的apk并手动安装。一样。
我似乎在Google上找不到任何东西。有没有人遇到过这个问题或对尝试什么有建议?我梳理了所有的配置文件,一切似乎都正确。我不知道代码就很难理解它,但是由于它仅供内部公司使用,所以我无法分享。
我已将我的全新Kindle Fire 7连接到我的Mac上,并且已经react-native run-android通过启用Hot Reload和Remote JS Debugging成功运行它.
在应用程序完全冻结(没有console.log语句显示,没有UI更新等)之前,一切似乎都能正常运行大约30分钟左右.当我摇动我的Fire时,会弹出调试菜单(重新加载,停止远程JS调试,启用实时重新加载等),但点击任何选项都是没有反应的.
如果我adb devices在Mac上运行此时,我发现Kindle Fire已断开连接.如果然后拔下USB连接到我的Fire,重新连接并react-native run-android再次运行,一切都会再次运行大约30分钟,然后再次无响应.
还有其他人遇到过这个问题吗?谢谢!
注意:我也非常怀疑我的代码崩溃了应用程序...我只是在那里用一个setInterval抓住当前时间的时间显示时间.但只是为了确定,我尝试只使用一个按钮打印到控制台上.在平板电脑上运行一段时间后,这也会停止工作.
如何从ReactNative打开其他应用程序(Gmail,相机)。如何将数据从当前场景传递到其他应用程序?
我试图向alert dialog用户展示点击button。我正在尝试如下
onPressButton() {
Alert.alert(strings.tour_end);
}
Run Code Online (Sandbox Code Playgroud)
strings.tour_end是“太好了!希望您喜欢我们的产品导览!喜欢这个应用程序。我们为您提供一些激动人心的优惠!”
我正在使用redux-persistReact Native项目,该项目在除Android 7之外的许多设备上都能正常运行。我试图调试为什么我的本地存储不持久的问题,并发现了这一点:
以下代码在React Native组件生命周期内执行
componentDidMount() {
attachObservables(store)
setInterval(async () => {
console.log('Inside setInterval')
const data = await AsyncStorage.getAllKeys()
console.log('inside the getAllKeys')
data.forEach(async k => {
const value = await AsyncStorage.getItem(k)
console.group(k)
console.log(value)
console.groupEnd()
})
}, 3000)
}
Run Code Online (Sandbox Code Playgroud)
从不调用“ Inside setInterval”之后的代码。如果在setInterval之外,它将仅运行一次。如果我一次调用setInterval 之外的代码,它似乎可以正常运行。我也尝试过回调格式与异步/等待版本,但这似乎无关紧要。
我在使用firebase js库时遇到了同样的问题(在第一个回调之后永远不会返回回调)。我现在正在寻找替代方法来解决此问题。
有任何想法吗?
我的应用程序在iOS上正常运行,但无法在Android上运行.我上周花了很多时间让它工作,并认为它是,并且问题已经恢复.
这里有完整的日志,以防有其他相关内容.https://pastebin.com/by6uCmPW
SyntaxError: \u can only be followed by a Unicode character sequence
Run Code Online (Sandbox Code Playgroud)
当我重新加载时,我得到一个白色屏幕,没有显示错误,我无法通过这个,并且它不会改变我是否连接到调试器.
我查看了源代码,错误来自以下行
这是来自React Native源的https://github.com/facebook/react-native/blob/a974c140db605ecbdf8d3faa7a079b7e2dcebb09/Libraries/ReactNative/YellowBox.js#L263
刷新后,我在logcat中收到以下错误,尽管模拟器中没有任何内容.
06-14 13:52:10.467:E/art(2691):没有找到com.facebook.react.bridge.Inspector com.facebook.react.bridge.Inspector.instance()的实现(试过Java_com_facebook_react_bridge_Inspector_instance和Java_com_facebook_react_bridge_Inspector_instance__)
我正在做一个本机应用程序,早些时候它工作正常,但现在当我运行"react-native run-android"时,在成功安装和启动后,我可以在模拟器中看到两个应用程序,它们都工作正常.
所以,任何想法为什么我看到2个应用程序,或者我应该说为什么我要安装一个额外的重复应用程序?
当我使用依赖项构建(> react-native run-android)时,构建成功!但是,当应用程序启动时,它立即崩溃...怎么不知道怎么可能,没有错误,没什么可告诉我为什么应用程序崩溃了...
确保它来自依赖项...
dependencies {
implementation project(':react-native-intercom')
implementation "io.intercom.android:intercom-sdk:3.+"
implementation project(':react-native-onesignal')
implementation 'com.google.android.gms:play-services-location:+'
implementation project(':react-native-linear-gradient')
implementation project(':react-native-i18n')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
implementation project(':tipsi-stripe')
implementation (project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
exclude group: "com.android.support", module: 'support-v4'
}
implementation "com.android.support:appcompat-v7:23.0.1"
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
implementation 'com.google.android.gms:play-services-gcm:10.0.1'
}
Run Code Online (Sandbox Code Playgroud)
非常感谢
android google-play-services react-native react-native-android
我有一个带有以下代码的React-Native应用程序(这里是App.js,应用程序入口点),用于管理Android上的深层链接。
Linking.getInitialURL().then((deepLinkUrl) => {
if (deepLinkUrl) {
manageDeepLink(deepLinkUrl);
} else {
Navigation.startSingleScreenApp('rootScreen');
}
});
Run Code Online (Sandbox Code Playgroud)
这里的问题是,每次我从深度链接或正常情况下启动我的应用程序时,都会调用getInitialURL,并且每次它包含deepLinkUrl参数为空时都会调用它。我已经在AndroidManifest中注册了我的意图,如下所示:
<application
android:name=".MainApplication"
android:allowBackup="true"
android:launchMode="singleTask"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize">
<!-- deeplink -->
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="myapp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
更新 我正在使用本机导航来注册屏幕,如果这可能有用的话。
android deep-linking react-native react-native-android react-native-navigation
在脱机模式下使用.set()函数在Firestore中创建文档时遇到了问题。但是.update(),.get()和.delete()函数在脱机模式下工作。
下面是代码片段
firebase.firestore().collection(this.state.mainCollectionId)
.doc(this.state.authKey)
.collection(collectionId.toString())
.doc(docId)
.get()
.then(docData => {
if (docData.exists) {
// console.log("daily Activity exists");
} else {
firebase.firestore().collection(this.state.mainCollectionId)
.doc(this.state.authKey)
.collection(collectionId.toString())
.doc(docId)
.set({
id:1234,
collectionId: collectionId.toString(),
authKey: this.state.userDatails.authKey,
name: this.state.userDatails.name,
email: this.state.userDatails.email
}).then(data =>{});
}
});
Run Code Online (Sandbox Code Playgroud)
和我得到的错误:
> Error: Firestore: The service is currently unavailable. (firestore/unavailable).
at createErrorFromErrorData (NativeModules.js:146)
at NativeModules.js:95
at MessageQueue.__invokeCallback (MessageQueue.js:392)
at MessageQueue.js:128
at MessageQueue.__guard (MessageQueue.js:291)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:127)
at debuggerWorker.js:72
Run Code Online (Sandbox Code Playgroud) android firebase react-native react-native-android google-cloud-firestore
react-native ×10
android ×7
asyncstorage ×1
deep-linking ×1
firebase ×1
react-redux ×1
reactjs ×1