我正在使用realm database
來維護我的應用程序中的產品日誌。我的應用程序在配置領域生成器時發生崩潰。我使用下面的代碼來配置領域構建器。無法在Gradle 3.0.0 beta2中配置Realm構建器
RealmConfiguration configuration = new RealmConfiguration.Builder(AddProductItems.this).build();
realm = Realm.getInstance(configuration);
realmHelper = new RealmHelper(realm);
我也試過這段代碼。
realm = Realm.getInstance(MyActivity.this);
我仍然得到同樣的error.I正在使用Android Studio 3.0 beta 2
和3.0.0-beta2 of gradle version
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "come.ajay.bill"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.0.0'
testImplementation 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:26.0.0'
compile 'com.android.support:cardview-v7:26.0.0'
provided 'io.realm:realm-android:0.87.5'
annotationProcessor 'io.realm:realm-android:0.87.5'
}
gradle這個(項目)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
這裏添加我的控制檯日誌
顯示您的其他Gradle文件以及應用的插件 – EpicPandaForce
@EpicPandaForce現在檢查。我更新了我的帖子 –