본문 바로가기

Android5

Unresolved reference: POST_NOTIFICATIONS Unresolved reference: POST_NOTIFICATIONS 에러 발생시 build.gradle의 compileSdk를 33으로 수정한다. compileSdk 33 2022. 10. 27.
build.gradle all buildscript {} blocks must appear before any plugins {} blocks in the script error buildScript의 위치가 plugins 보다 뒤에 있으면 안된다. 아래처럼 해결 buildscript { repositories { // Make sure that you have the following two repositories google() // Google's Maven repository mavenCentral() // Maven Central repository } dependencies { // Add the dependency for the Google services Gradle plugin classpath 'com.google.gms:google-services:4.3.13' } } plugins { id 'com.android.application' version '7.3.. 2022. 10. 26.
Android Butter Knife 적용하기 Android Activity를 개발 할 때 제일 먼저 하는 일이 무엇일까? 바로 새로운 Layout을 만들어서 적용하고 Layout에 포함되어 있는 view에 event listener를 달아주거나view들을 읽어와서 business logic에 맞게 개발을 할 것이다. Layout에 포함된 view에 접근하기 위해서는 아래와 같이 작업을 하게 된다. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ImageView settingsImage = (ImageView) findViewById(R.id.imag.. 2017. 2. 4.
Robolectric Getting Started build.gradle에 아래 내용을 추가한다. testCompile "org.robolectric:robolectric:3.2.2" Test Class에 Robolectric Annotation을 추가한다. package org.robolectric.myreference; import org.junit.Before; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) @Config(constants = BuildConfig.class) public class MainActi.. 2017. 1. 23.