I clone some project.
To run app, must input my API KEY instead of placeholder.
In above file, I input my API KEY instead of "MyOpenWeatherMapApiKey".
But BuildConfig.java linked with app/build.gradle doesn't create quotes(") and occurs error.
app/build.gradle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.android.sunshine.app" minSdkVersion 10 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } buildTypes.each { it.buildConfigField 'String', 'OPEN_WEATHER_MAP_API_KEY', MyOpenWeatherMapApiKey } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.2' } | cs |
BuildConfig.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /** * Automatically generated file. DO NOT MODIFY */ package com.example.android.sunshine.app; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.example.android.sunshine.app"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; // Fields from build type: debug public static final String OPEN_WEATHER_MAP_API_KEY = MyOpenWeatherMapApiKey; } | cs |
As a result, I solve the quotes problem by adding \"
For more detail, refer this URL.
'Android > Knowhow' 카테고리의 다른 글
ScrollView의 height를 match_parent하기 (0) | 2016.12.27 |
---|---|
배열 객체는 가급적 쓰지말자 (0) | 2016.12.23 |
안드로이드 스튜디오 cannot resolve symbol r :: 강력한 해결법 (4) | 2015.11.26 |
[JAVA] input char array to special chars (0) | 2015.11.11 |
[color] Hex Opacity Values (0) | 2015.09.25 |