Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

expo :app:configureCMakeRelWithDebInfo[arm64-v8a] 에러

 expo 프로젝트에서 안드로이드 빌드를 하다가

node_modules/@react-native-async-storage/async-storage/android/build/generated/source/codegen/jni/


이런 폴더를 찾을 수 없다는 에러를 뿜었다.


기존까지는 잘되던 빌드였는데,

node_modules 폴더를 삭제한 후 새롭게 패키지들을 다시 설치하고, (npm ci)

android 를 빌드하니 해당 에러가 생겨났다.


원래 빌드를 하면 해당 폴더가 자동으로 생성된다.

하지만 한번 빌드했던 프로젝트는 node_modules를 삭제하고 다시 패키지를 설치했더라도, 해당 프로세스를 건너뛰게 된다.

결론부터 말하자면 android-studio 캐시 문제였다.

해결하는 방법은 2가지이다.


1. android studio 캐시를 삭제하기

    Android Studio ▸ File ▸ Invalidate Caches / Restart… ▸ Invalidate & Restart

2. 수동으로 해당 cmake 파일 만들어주기

    ./gradlew generateCodegenArtifactsFromSchema    


둘중 하나만 하면 된다.

그다음부턴 빌드 잘됨.

node_modules안에서 확인해봐도 해당 폴더가 잘 생겨진걸 확인할 수 있다.

안드로이드 스튜디오 풀스크린 (전면카메라 노치영역 없애기) (내비게이션바)

 갤럭시로 풀스크린 어플을 개발하던 중

단순히 액션바만 없애는게 아니라

전면카메라 펀치홀이 존재하는 노치영역까지도 확장된 풀스크린을 하고자 한다.


일단 전체 소스코드

<resources>
<style name="FullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowFullscreen">true</item>
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
</resources>


Theme에서 NoActionBar를 상속하는 테마를 만들고

맨 위의 아이템은 풀스크린,

그 아래 3줄이 펀치홀까지 확장하는 코드이다.

API27 이상부터 적용되는 사항이다.

출처: https://stackoverflow.com/questions/49190381/fullscreen-app-with-displaycutout


내비게이션바를 없애려면

아래소스코드를 추가해준다.

private View decorView;
private int uiOption;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

decorView = getWindow().getDecorView();
uiOption = getWindow().getDecorView().getSystemUiVisibility();
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH )
uiOption |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN )
uiOption |= View.SYSTEM_UI_FLAG_FULLSCREEN;
if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT )
uiOption |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;

decorView.setSystemUiVisibility( uiOption );


출처 : http://cloudylab.blogspot.com/2015/02/android-full-screen.html



Android Studio... Start!!

I decided to make some gorgeous Android Application.

I used 'Eclipse' few years ago, but now, Google support 'Android Studio' rather than 'Eclipse'. I have no other choice.

I started to download 'Android Studio'. It took too long because of its huge size.

I remembered that Eclipse has small size and not so heavy to work with it.

As new software got bigger, I'm expecting that it has efficient tools and is easy to use.