小编gbe*_*ule的帖子

React Native 无法启动模拟器

在尝试测试使用 React Native 创建的 android 应用程序时,我遇到了这个错误

info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
Run Code Online (Sandbox Code Playgroud)

我在 android studio 中安装了模拟器(AMD 版本)。

我怎么解决这个问题

android reactjs react-native

8
推荐指数
1
解决办法
2万
查看次数

使用 React Native SQLite 存储模块使用事务函数在 SQLite 中创建多个表

我想要做的是为我的react-native android应用程序创建多个表,但每次执行代码时它都会返回未知错误(但它可以很好地创建单个表)。

这是我的代码

initDB() {
    let db;
    return new Promise((resolve) => {
        console.log("Plugin integrity check ...");
        SQLite.echoTest()
            .then(() => {
                console.log("Integrity check passed ...");
                console.log("Opening database ...");
                SQLite.openDatabase(
                    database_name,
                    database_version,
                    database_displayname,
                    database_size
                )
                    .then(DB => {
                        db = DB;
                        console.log("Database OPEN");
                        db.executeSql('SELECT 1 FROM Feed LIMIT 1').then(() => {
                            console.log("Database is ready ... executing query ...");
                        }).catch((error) =>{
                            console.log("Received error: ", error);
                            console.log("Database not yet ready ... populating data");
                            db.transaction((tx) => {
                                tx.executeSql('CREATE TABLE IF NOT EXISTS Feed (feedId, feedName, …
Run Code Online (Sandbox Code Playgroud)

sqlite react-native react-native-sqlite-storage

5
推荐指数
1
解决办法
2852
查看次数