teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

gradle

2018/09/19 06:11

投稿

pecchan
pecchan

スコア592

title CHANGED
File without changes
body CHANGED
@@ -36,4 +36,83 @@
36
36
 
37
37
  分かる方教えていただけないでしょうか?
38
38
 
39
- 宜しくお願い致します。
39
+ 宜しくお願い致します。
40
+
41
+ 2018/09/19 追記
42
+ Ankoへの参照がうまくいってないのでしょうか?
43
+ gradleのコードを追記します。
44
+
45
+
46
+ \AlarmApp\build.gradle
47
+ ※ この1行を追加しました→ext.anko_version = '0.10.4'
48
+ ```java
49
+ // Top-level build file where you can add configuration options common to all sub-projects/modules.
50
+
51
+ buildscript {
52
+ ext.kotlin_version = '1.2.61'
53
+ ext.anko_version = '0.10.4' //これを追加
54
+ repositories {
55
+ google()
56
+ jcenter()
57
+ }
58
+ dependencies {
59
+ classpath 'com.android.tools.build:gradle:3.1.3'
60
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
61
+
62
+ // NOTE: Do not place your application dependencies here; they belong
63
+ // in the individual module build.gradle files
64
+ }
65
+ }
66
+
67
+ allprojects {
68
+ repositories {
69
+ google()
70
+ jcenter()
71
+ }
72
+ }
73
+
74
+ task clean(type: Delete) {
75
+ delete rootProject.buildDir
76
+ }
77
+
78
+ ```
79
+
80
+ AlarmApp\app\build.gradle
81
+ ※この1行を追加しました→implementation "org.jetbrains.anko:anko-commons:$anko_version"
82
+ ```java
83
+ apply plugin: 'com.android.application'
84
+
85
+ apply plugin: 'kotlin-android'
86
+
87
+ apply plugin: 'kotlin-android-extensions'
88
+
89
+ android {
90
+ compileSdkVersion 28
91
+ defaultConfig {
92
+ applicationId "com.example.administrator.alarmapp"
93
+ minSdkVersion 21
94
+ targetSdkVersion 28
95
+ versionCode 1
96
+ versionName "1.0"
97
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
98
+ }
99
+ buildTypes {
100
+ release {
101
+ minifyEnabled false
102
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
103
+ }
104
+ }
105
+ }
106
+
107
+ dependencies {
108
+ implementation "org.jetbrains.anko:anko-commons:$anko_version" //これを追加
109
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
110
+ implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
111
+ implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
112
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
113
+ testImplementation 'junit:junit:4.12'
114
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
115
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
116
+ }
117
+
118
+ ```