質問編集履歴
4
プロジェクトルートのbuild\.gradleファイルとappの下にあるbuild\.gradleファイルを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,4 +42,130 @@
|
|
42
42
|
|
43
43
|
ScheduleはRealmObjectを継承したクラスです。
|
44
44
|
|
45
|
+
↓にプロジェクトルートのbuild.gradleと、appの下にあるbuild.gradleを載せます。
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
プロジェクトルートのbuild.gradle
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
/ Top-level build file where you can add configuration options common to all sub-projects/modules.
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
buildscript {
|
58
|
+
|
59
|
+
repositories {
|
60
|
+
|
61
|
+
jcenter()
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
dependencies {
|
66
|
+
|
67
|
+
classpath 'com.android.tools.build:gradle:2.2.0'
|
68
|
+
|
69
|
+
classpath "io.realm:realm-gradle-plugin:1.2.0"
|
70
|
+
|
71
|
+
// NOTE: Do not place your application dependencies here; they belong
|
72
|
+
|
73
|
+
// in the individual module build.gradle files
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
allprojects {
|
82
|
+
|
83
|
+
repositories {
|
84
|
+
|
85
|
+
jcenter()
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
task clean(type: Delete) {
|
94
|
+
|
95
|
+
delete rootProject.buildDir
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
```
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
appの下にあるbuild.gradle
|
104
|
+
|
105
|
+
```
|
106
|
+
|
107
|
+
apply plugin: 'com.android.application'
|
108
|
+
|
109
|
+
apply plugin: 'realm-android'
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
android {
|
114
|
+
|
115
|
+
compileSdkVersion 24
|
116
|
+
|
117
|
+
buildToolsVersion "24.0.2"
|
118
|
+
|
119
|
+
defaultConfig {
|
120
|
+
|
121
|
+
applicationId "com.example.tomotaro.myscheduler"
|
122
|
+
|
123
|
+
minSdkVersion 15
|
124
|
+
|
125
|
+
targetSdkVersion 24
|
126
|
+
|
127
|
+
versionCode 1
|
128
|
+
|
129
|
+
versionName "1.0"
|
130
|
+
|
131
|
+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
132
|
+
|
133
|
+
}
|
134
|
+
|
45
|
-
|
135
|
+
buildTypes {
|
136
|
+
|
137
|
+
release {
|
138
|
+
|
139
|
+
minifyEnabled false
|
140
|
+
|
141
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
142
|
+
|
143
|
+
}
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
dependencies {
|
152
|
+
|
153
|
+
compile fileTree(include: ['*.jar'], dir: 'libs')
|
154
|
+
|
155
|
+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
156
|
+
|
157
|
+
exclude group: 'com.android.support', module: 'support-annotations'
|
158
|
+
|
159
|
+
})
|
160
|
+
|
161
|
+
compile 'com.android.support:appcompat-v7:24.2.1'
|
162
|
+
|
163
|
+
compile 'com.android.support:design:24.2.1'
|
164
|
+
|
165
|
+
testCompile 'junit:junit:4.12'
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
```
|
3
バージョンが違っていたため修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Android StudioでRealmを使いたい
|
test
CHANGED
@@ -1 +1,45 @@
|
|
1
|
+
Android Studio2.2
|
2
|
+
|
3
|
+
realm-java-1.2.0
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
初心者です。
|
8
|
+
|
1
|
-
....
|
9
|
+
Realmの最新版は2.0.1らしいのですが公式でダウンロードボタンを押すと1.2.0の
|
10
|
+
|
11
|
+
ダウンロードが始まり、2.0.0のページでも同じことが起こったので、1.2.0を使っています。
|
12
|
+
|
13
|
+
Android StudioでRealmを用いてスケジュールアプリを作ろうとしています。
|
14
|
+
|
15
|
+
下に示すのはrealm-java-1.2.0の公式サイトです。
|
16
|
+
|
17
|
+
https://realm.io/docs/java/1.2.0/
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
質問は、公式サイトに書いてあることだけを行えば導入されたことになるのかということです。
|
22
|
+
|
23
|
+
ステップ1とステップ2に書いたことはやりましたが、これだけでいいのかと違和感を覚えます。
|
24
|
+
|
25
|
+
ダウンロードしたzipファイルはDownloadフォルダに入っていて、そこで解凍しただけです。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
コーディングしたアプリをRunさせると
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
Error:Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'.
|
34
|
+
|
35
|
+
> javassist.NotFoundException: io.realm.ScheduleRealmProxyInterface
|
36
|
+
|
37
|
+
```
|
38
|
+
|
39
|
+
というエラーメッセージが出ます。
|
40
|
+
|
41
|
+
io.realm.ScheduleRealmProxyInterfaceがよくわからず困っています。
|
42
|
+
|
43
|
+
ScheduleはRealmObjectを継承したクラスです。
|
44
|
+
|
45
|
+
よろしくお願いします。
|
2
\.
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
...
|
test
CHANGED
File without changes
|
1
\.
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,157 +1 @@
|
|
1
|
-
Android Studio2.2
|
2
|
-
|
3
|
-
realm-android-0.85.1.jar
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
Android StudioでRealmを用いてスケジュールアプリを作ろうとしています。
|
8
|
-
|
9
|
-
Runさせると
|
10
|
-
|
11
|
-
```
|
12
|
-
|
13
|
-
Error:Execution failed for task ':app:transformClassesWithRealmTransformerForDebug'.
|
14
|
-
|
15
|
-
> javassist.NotFoundException: io.realm.ScheduleRealmProxyInterface
|
16
|
-
|
17
|
-
```
|
18
|
-
|
19
|
-
というエラーメッセージが出ます。
|
20
|
-
|
21
|
-
io.realm.ScheduleRealmProxyInterfaceがよくわからず困っています。
|
22
|
-
|
23
|
-
ScheduleはRealmObjectを継承したクラスです。
|
24
|
-
|
25
|
-
|
1
|
+
.........................................
|
26
|
-
|
27
|
-
何が悪いのか、どうすればよいのかを教えてほしいです。よろしくお願いします
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
以下の2つのソースファイルが悪いのではないかと考えています。
|
32
|
-
|
33
|
-
下に示すのはプロジェクトのトップレベルにあるbuild.gradleファイルです。
|
34
|
-
|
35
|
-
```
|
36
|
-
|
37
|
-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
buildscript {
|
42
|
-
|
43
|
-
repositories {
|
44
|
-
|
45
|
-
jcenter()
|
46
|
-
|
47
|
-
}
|
48
|
-
|
49
|
-
dependencies {
|
50
|
-
|
51
|
-
classpath 'com.android.tools.build:gradle:2.2.0'
|
52
|
-
|
53
|
-
classpath "io.realm:realm-gradle-plugin:1.1.0"
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
// NOTE: Do not place your application dependencies here; they belong
|
58
|
-
|
59
|
-
// in the individual module build.gradle files
|
60
|
-
|
61
|
-
}
|
62
|
-
|
63
|
-
}
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
allprojects {
|
68
|
-
|
69
|
-
repositories {
|
70
|
-
|
71
|
-
jcenter()
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
task clean(type: Delete) {
|
80
|
-
|
81
|
-
delete rootProject.buildDir
|
82
|
-
|
83
|
-
}
|
84
|
-
|
85
|
-
```
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
下に示すのはapp内のbuild.gradleファイルです。
|
90
|
-
|
91
|
-
```
|
92
|
-
|
93
|
-
apply plugin: 'com.android.application'
|
94
|
-
|
95
|
-
apply plugin: 'realm-android'
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
android {
|
100
|
-
|
101
|
-
compileSdkVersion 24
|
102
|
-
|
103
|
-
buildToolsVersion "24.0.2"
|
104
|
-
|
105
|
-
defaultConfig {
|
106
|
-
|
107
|
-
applicationId "com.example.tomotaro.myscheduler"
|
108
|
-
|
109
|
-
minSdkVersion 15
|
110
|
-
|
111
|
-
targetSdkVersion 24
|
112
|
-
|
113
|
-
versionCode 1
|
114
|
-
|
115
|
-
versionName "1.0"
|
116
|
-
|
117
|
-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
|
-
buildTypes {
|
122
|
-
|
123
|
-
release {
|
124
|
-
|
125
|
-
minifyEnabled false
|
126
|
-
|
127
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
128
|
-
|
129
|
-
}
|
130
|
-
|
131
|
-
}
|
132
|
-
|
133
|
-
}
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
dependencies {
|
138
|
-
|
139
|
-
compile fileTree(include: ['*.jar'], dir: 'libs')
|
140
|
-
|
141
|
-
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
142
|
-
|
143
|
-
exclude group: 'com.android.support', module: 'support-annotations'
|
144
|
-
|
145
|
-
})
|
146
|
-
|
147
|
-
compile 'com.android.support:appcompat-v7:24.2.1'
|
148
|
-
|
149
|
-
compile 'com.android.support:design:24.2.1'
|
150
|
-
|
151
|
-
testCompile 'junit:junit:4.12'
|
152
|
-
|
153
|
-
compile files('libs/realm-android-0.85.1.jar')
|
154
|
-
|
155
|
-
}
|
156
|
-
|
157
|
-
```
|