buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath "io.realm:realm-gradle-plugin:2.1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.app.practice.realm.realmpractice"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'
}
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
编译失败;有关详细信息,请参阅编译器错误输出。
用户类:
package com.app.practice.realm.realmpractice;
import io.realm.RealmObject;
public class User extends RealmObject {
private int id;
private String name;
}
Myapplication文件
import android.app.Application;
import io.realm.Realm;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Realm.init(this);
}
}
Note: Processing class User
Note: Creating DefaultRealmModule
An exception has occurred in the compiler (1.8.0_05). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
FAILED
尝试:使用--info或--debug选项运行以获取更多日志输出。
根据https://realm.io/docs/java/latest/#jackson-databind
1)制作一个名为“RX”的包
2)在包内创建一个名为“Observable”空类,如下所示:
package rx;
public class Observable {
}
我只是想继续我的应用程序,而我得到了这个编译错误,我不知道它是从哪里开始的: 这是我的分级文件:
任务:app:compiledebugjavawithjavac e:android10\platforms\android\app\src\main\java\org\apache\cordova\filetransfer\filetransfer.java:59:错误:找不到符号导入org.apache.cordova.whitelist;^symbol:类白名单位置:package org.
错误:任务执行失败 ': app:使用合并Java Res For Debug转换资源'。 com.android.build.api.transform.TransformException:com.android.builder.packaging.DuplicateFileException: APK META-INF/LICENSE File1中复制的重复文件: C:\用户Jithin-P
失败:生成失败,出现异常。 > 错误:任务“:app:CompiledEbugJavaWithJavac”执行失败。 编译失败;有关详细信息,请参阅编译器错误输出。
Build.Gradle: 当获取: