我尝试在stackoverflow上查找其他类似的问题,他们建议我们改变版本的"buildToolsVersion",但我在gradle文件中看不到这样的单词.
我的Gradle文件(PROJECT): -
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
我的build.gradle(模块:app):这是我的第二个gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.dhruv.testhello"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), …Run Code Online (Sandbox Code Playgroud) 我准备了一个代码来在 SQLITE ANDROID STUDIO 中创建数据库和表,但是我在 SQL 语句中遇到错误。
package com.example.thakkar.registration;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.view.View;
public class DataBaseHelper extends SQLiteOpenHelper {
public static final String DATABASAE_NAME="student.db";
public static final String TABLE_NAME="student_table";
public static final String COL_1="NAME";
public static final String COL_2="EMAIL";
public static final String COL_3="PASSWORD";
public DataBaseHelper(Context context) {
super(context, DATABASAE_NAME, null, 1);
SQLiteDatabase db=this.getWritableDatabase();
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table"+ TABLE_NAME+ "(NAME TEXT,EMAIL TEXT,PASSWORD TEXT)");
}
@Override
public void onUpgrade(SQLiteDatabase …Run Code Online (Sandbox Code Playgroud)