HOME
홈페이지제작
쇼핑몰제작
어플리케이션
기능별홈페이지
포트폴리오
ERP 솔루션
유지보수
온라인마케팅
커뮤니티
테크

react native splash E0.68.+ error 대응 > 자료실

본문 바로가기

홈페이지

어플

프로그램

오늘 방문자

제작상담

■ 어떠한 것이든 설명이 가능하시면 제작이 가능합니다.
■ 각종 다양한 어플리케이션 제작경험이 많습니다.
■ 다양한 유형별 홈페이지,쇼핑몰 제작경험이 많습니다.
■ 업종별 주문형 프로그램 제작 가능합니다.
메타버스 제작 가능합니다.
VR,AR 이용한 결과물 및 모듈제작 가능합니다.
■ 상시채용 : php,java,ios,android,ar,vr,c#,Node

고객평가

  • 니즈가 명확하지 않아 ...
  • 기획 단계부터 먼저 여...
  • 저희 앱이 일본어 사전...
  • 과격한 표현으로 말하자...
  • 앱 쪽에 정보가 많이 ...
  • 디몬스터를 처음 만났을...
  • 처음했던 외주 개발인데...
자료실

React Native | react native splash E0.68.+ error 대응

페이지 정보

작성자 이호섭 작성일22-04-25 16:00 조회17,370회 댓글0건

본문

 

https://hallowed-handspring-1c3.notion.site/react-native-splash-E0-68-error-5d5461b93a784c9d8426ece793279878


Make로 작업하시는 분들에 한해 에러 처리 방법입니다.

Make를 사용안하시는 분들은 1단계 방법추가하시고 SplashScreen.show(this, R.style.SplashScreenTheme, true); 3번째 매개변수 전달하면 됩니다.

  1. react-native-splash-screen 설치

yarn add react-native-splash-screen

react-naitve link react-native-splash-screen

  1. @bam.tech/react-native-make 설치

yarn add @bam.tech/react-native-make

react-native set-splash --path 경로 --resize center --background 색상

하시게 되면 아래와 같이 MAinActivity.java에 생성이 됩니다.

public class MainActivity extends ReactActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme);

super.onCreate(savedInstanceState);

} /** * Returns the name of the main component registered from JavaScript. This is used to schedule * rendering of the component. */ @Override protected String getMainComponentName() { return "test"; } /** * Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and

* you can specify the rendered you wish to use (Fabric or the older renderer).

*/ @Override

protected ReactActivityDelegate createReactActivityDelegate() {

return new MainActivityDelegate(this, getMainComponentName());

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme);

super.onCreate(savedInstanceState);

} }


public static class MainActivityDelegate extends ReactActivityDelegate {

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme);

super.onCreate(savedInstanceState);

}

public MainActivityDelegate(ReactActivity activity, String mainComponentName) {

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme);

super.onCreate(savedInstanceState);

}

super(activity, mainComponentName); } @Override

protected ReactRootView createRootView() {

ReactRootView reactRootView = new ReactRootView(getContext());

// If you opted-in for the New Architecture, we enable the Fabric Renderer.

reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);

return reactRootView; } } }

여기서 이대로 사용하시게 되면 에러가 발생합니다. 메이커 사용하기 전 MainActivity에서 한가지만 더 추가해서 사용하시면 됩니다.

//MainActivity 상단

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme, true);

super.onCreate(savedInstanceState); }

전체코드

public class MainActivity extends ReactActivity {

@Override

protected void onCreate(Bundle savedInstanceState) {

SplashScreen.show(this, R.style.SplashScreenTheme, true);

super.onCreate(savedInstanceState);

} /** * Returns the name of the main component registered from JavaScript. This is used to schedule

* rendering of the component.

*/ @Override

protected String getMainComponentName() {

return "Onnuri_driving";

} /**

* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and

* you can specify the rendered you wish to use (Fabric or the older renderer).

*/

@Override

protected ReactActivityDelegate createReactActivityDelegate() {

return new MainActivityDelegate(this, getMainComponentName());

} public static class MainActivityDelegate extends ReactActivityDelegate {

public MainActivityDelegate(ReactActivity activity, String mainComponentName) {

super(activity, mainComponentName);

} @Override

protected ReactRootView createRootView() {

ReactRootView reactRootView = new ReactRootView(getContext());

// If you opted-in for the New Architecture, we enable the Fabric Renderer.

reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);

return reactRootView;

}


}​ ​ 

 

 


| 디몬스터 | TEL : 070-7621-0572 / 070-5022-0572 | HP : 010-7574-0572 | E-mail : jackee@naver.com
| 서울 구로구 구로동 222 7번지 코오롱디지털타워빌란트 15층 1509,10호 | 부천시 길주로 272 2001호(중동 코스모폴리탄) | 부산시 금정구 금정로 225 4층,5층 | 몽골사무실- Ulaannaatar.mongola bayangol district 3-khoroo agro center 9-02
당사의 어플방식은 저작권 및 특허출원중입니다. 복제,모방,변용 및 유사 상행위 적발시,경고,통보없이 민형사상 책임을 진행합니다
Copyright © www.dmonster.co.kr All rights reserved.Since 2008 (주)세미콜론즈 · 사업자번호: 801-88-00338