質問編集履歴

2

誤字

2018/09/10 06:41

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- android studioへのgoogle cloud vision apiの取り込み方
1
+ android studioへのgoogle cloud vision apiのサンプルの取り込み方
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  初心者です。
4
4
 
5
- android studioにGitHubからダウンロードしたgoogle cloud vision apiのサンプルを入れたのですが、次のようなエラーが出てしまいます。
5
+ android studioにGitHubからダウンロードしたgoogle cloud vision apiのサンプルを入れたのですが、次のようなエラーが出てしまいます。
6
6
 
7
7
  すみませんがわかる方教えてくださいませんか。
8
8
 

1

ソースコードの記載

2018/09/10 06:41

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,10 +1,10 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- android studioにgoogle cloud vision apiのサンプルを入れたいのですが、
3
+ 初心者です
4
4
 
5
- it.buildConfigFieldのでエラーが出てしまいます。
5
+ android studioにGitHubからダウンロードしたgoogle cloud vision apiサンプルを入れたいのすが、次のようなエラーが出てしまいます。
6
6
 
7
- すみませんがわかる方教えてください。
7
+ すみませんがわかる方教えてくださいませんか
8
8
 
9
9
 
10
10
 
@@ -12,9 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- ```
16
15
 
17
- エラーメッセージ
18
16
 
19
17
  Error:(14, 40) エラー: シンボルを見つけられません
20
18
 
@@ -26,7 +24,39 @@
26
24
 
27
25
  ### 該当のソースコード
28
26
 
27
+ ```
28
+
29
+ build.gradle(Module:app)
30
+
31
+
32
+
33
+ apply plugin: 'com.android.application'
34
+
35
+
36
+
37
+ android {
38
+
39
+ compileSdkVersion 27
40
+
41
+ buildToolsVersion "27.0.3"
42
+
43
+
44
+
45
+ defaultConfig {
46
+
47
+ applicationId "com.google.sample.cloudvision"
48
+
49
+ minSdkVersion 24
50
+
51
+ targetSdkVersion 27
52
+
53
+ versionCode 1
54
+
55
+ versionName "1.0"
56
+
57
+ }
58
+
29
- buildTypes {
59
+ buildTypes {
30
60
 
31
61
  release {
32
62
 
@@ -38,30 +68,84 @@
38
68
 
39
69
  buildTypes.each {
40
70
 
41
- it.buildConfigField 'String', 'API_KEY', ApiKey
71
+ it.buildConfigField 'String', 'API_KEY',Apikey
42
72
 
43
73
  }
44
74
 
45
75
  }
46
76
 
47
- ```ここに言語名を入力
77
+ compileOptions {
48
78
 
79
+ sourceCompatibility JavaVersion.VERSION_1_8
80
+
81
+ targetCompatibility JavaVersion.VERSION_1_8
82
+
83
+ }
84
+
85
+ }
86
+
87
+
88
+
49
- ソースコード
89
+ dependencies {
90
+
91
+ compile fileTree(include: ['*.jar'], dir: 'libs')
92
+
93
+ testCompile 'junit:junit:4.12'
94
+
95
+ compile 'com.android.support:appcompat-v7:27.0.2'
96
+
97
+ compile 'com.android.support:design:27.0.2'
98
+
99
+ compile 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
100
+
101
+ compile 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
102
+
103
+ compile 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
104
+
105
+ }
50
106
 
51
107
  ```
52
108
 
53
109
 
54
110
 
55
- ### 試したこと
111
+ ```java
112
+
113
+ BuildConfig.java
56
114
 
57
115
 
58
116
 
117
+ /**
118
+
119
+ * Automatically generated file. DO NOT MODIFY
120
+
121
+ */
122
+
59
- ここに問題に対して試したことを記載してください。
123
+ package com.google.sample.cloudvision;
60
124
 
61
125
 
62
126
 
127
+ public final class BuildConfig {
128
+
129
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
130
+
131
+ public static final String APPLICATION_ID = "com.google.sample.cloudvision";
132
+
133
+ public static final String BUILD_TYPE = "debug";
134
+
135
+ public static final String FLAVOR = "";
136
+
137
+ public static final int VERSION_CODE = 1;
138
+
139
+ public static final String VERSION_NAME = "1.0";
140
+
141
+ // Fields from build type: debug
142
+
143
+ public static final String API_KEY = Apikey;
144
+
145
+ }
146
+
147
+ ```
148
+
63
149
  ### 補足情報(FW/ツールのバージョンなど)
64
150
 
65
-
66
-
67
- ここにより詳細な情報を記載してください。
151
+ AndroidStudio3.0