2
votes

hello I am new with react native , i tried to install react-native-sqlite-storage alter installing and i follow all instruction for android setup : [https://www.npmjs.com/package/react-native-sqlite-storage][1]

i tried to run it using the command :react-native run-android , it all the time i am getting the error :

FAILURE: Build failed with an exception. What went wrong: Could not determine the dependencies of task ':app:mergeDebugAssets'. Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. Could not resolve project :react-native-sqlite-storage. Required by: project :app Unable to find a matching configuration of project :react-native-sqlite-storage: None of the consumable configurations have attributes. Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 1s Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html Command failed: gradlew.bat installDebug Error: Command failed: gradlew.bat installDebug at checkExecSyncError (child_process.js:616:11) at Object.execFileSync (child_process.js:634:13) at runOnAllDevices (D:\RN\SqlApp1\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19) at buildAndRun (D:\RN\SqlApp1\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12) at isPackagerRunning.then.result (D:\RN\SqlApp1\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12) at process._tickCallback (internal/process/next_tick.js:68:7)

could you advice how to sort this out ? thanks

1
write your android configuration code here.Mitesh jadav
Step 2 - Update Gradle Settings (located under Gradle Settings in Project Panel) // file: android/settings.gradle ... include ':react-native-sqlite-storage' project(':react-native-sqlite-storage').projectDir = new File(rootProject.projroche
Step 3 - Update app module Gradle Build script (located under Gradle Settings in Project Panel) // file: android/app/build.gradle ... dependencies { ... compile project(':react-native-sqlite-storage') }roche
import org.pgsqlite.SQLitePluginPackage; public class MainApplication extends Application implements ReactApplication { ...... /** * A list of packages used by the app. If the app uses additional views * or modules besides the default ones, add more packages here. */ @Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new SQLitePluginPackage(), // register SQLite Plugin here new MainReactPackage()) } }roche
Please add any additional information to your question.chrisis

1 Answers

4
votes

Try this

Go to your settings.gradle file and change THIS LINE

project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/src/android')

TO

project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/platforms/android')

refer this