728x90
반응형

./gradlew assembleRelase 로 해당 에러가나서 검색해보니

 

./graldew app:assembleRelease 로 해결했다는 글을 찾았다.

 

해당 명령어로 빌드하니 성공.

728x90
반응형
728x90
반응형

앱 아이콘 제네레이터에서 앱아이콘을 png 형태로 받아서 그냥 사용했더니

 

AAPT: error: failed to read PNG signature: file does not start with PNG signature.

 

해당 에러가 나왔다.

 

png 형태를 jpg로 강제변환해주고

 

jpg2png 사이트에서 한번도 저장하니 정상작동했다.

728x90
반응형
728x90
반응형
$ react-native start --reset-cache

로 해결.

 

종종 yarn add 후 발생한다

728x90
반응형
728x90
반응형

일단 기존에 2대를 연결해 놓았기때문에

 

adb kill-server

 

로 adb 를 초기화

 

adb tcpip 5555

 

입력 후 

 

adb connect 192.168.0.194:5555

adb connect 192.168.0.54:5555 

 

하면

 

adb devices

 

일때

 

연결이 완료되었다

728x90
반응형
728x90
반응형

mobx 를 사용하면

 

[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `<Observer>{fn}</Observer>` instead, or wrap the entire component in `observer`. 

 

해당 에러가 나오기 마련이다.

 

import {Observer, useObserver} from 'mobx-react-lite';
import React, {useContext} from 'react';
import {storesContext} from '../utils/context';

export const useStoreData = (context, storeSelector, dataSelector) => {
const value = useContext(context);
if (!value) {
throw new Error('No store');
}
const store = storeSelector(value);

return useObserver(() => {
return dataSelector(store);
});
};

export default dataSelector => {
return useStoreData(storesContext, contextData => contextData, dataSelector);
};

해당 부분을

 

import {Observer, useObserver} from 'mobx-react-lite';
import React, {useContext} from 'react';
import {storesContext} from '../utils/context';

export const useStoreData = (context, storeSelector, dataSelector) => {
const value = useContext(context);
if (!value) {
throw new Error('No store');
}
const store = storeSelector(value);

return (
<Observer>
{() => {
return dataSelector(store);
}}
</Observer>
);
};

export default dataSelector => {
return useStoreData(storesContext, contextData => contextData, dataSelector);
};

로 변경해주면 warning 사라짐

728x90
반응형
728x90
반응형
@stomp/stompjs
sockjs-client

해당 라이브러리들을 yarn 을통해 받아주고

const connectHaner = () => {
const sock = new SockJS('http://192.168.0.77:8080/wowplanet');

const stompClient = Stomp.over(sock);

stompClient.connect(
{},
() => {
console.log('complete');
stompClient.subscribe('/topic/public', payload => {
console.log(payload.body);
});
},
// ,
() => {
console.log('error');
},
);
};

해당 코드로 connect를 시도했는데

 WARN  Possible Unhandled Promise Rejection (id: 1):

ReferenceError: Property 'TextEncoder' doesn't exist

ReferenceError: Property 'TextEncoder' doesn't exist

 

에러가 나왔다

 

TextEncoder 라이브러리를 설정해주기위해

 

root 에

globals.js 를 만들어주고

 

해당 파일에

global.TextEncoder = require('text-encoding').TextEncoder;

설정뒤

 

index.js 에서

 

import './globals.js';

를 해주니 정상 작동했다.

728x90
반응형
728x90
반응형

App.tsx 에서 progress / message 받아서 사용

OTA 방식처러 보인다

 

직접 작성한 코드라 변경하셔서 사용하십셔

import { useEffect, useState } from 'react';
import CodePush, { DownloadProgress } from 'react-native-code-push';

const codePushOptions = {
checkFrequency: CodePush.CheckFrequency.ON_APP_START,
// 추후 업로드 시, 업데이트 알림 띄우는 용도
updateDialog: {
title: '...',
optionalUpdateMessage: '...',
optionalInstallButtonLabel: '업데이트',
optionalIgnoreButtonLabel: '아니요.',
},
installMode: CodePush.InstallMode.IMMEDIATE,
};

export const useCodePush = () => {
const [progress, setProgress] = useState<DownloadProgress | boolean>(true);
const [message, setMessage] = useState<string>('Checking for update');

const codePushStatusDidChange = (syncStatus: CodePush.SyncStatus) => {
switch (syncStatus) {
case CodePush.SyncStatus.CHECKING_FOR_UPDATE:
console.log('[CodePush] Checking for update.');
setMessage('Checking for update.');
break;
case CodePush.SyncStatus.DOWNLOADING_PACKAGE:
console.log('[CodePush] Downloading package.');
setMessage('Downloading package.');
break;
case CodePush.SyncStatus.AWAITING_USER_ACTION:
console.log('[CodePush] Awaiting user action.');
setMessage('Awaiting user action.');
break;
case CodePush.SyncStatus.INSTALLING_UPDATE:
console.log('[CodePush] Installing update.');
setMessage('Installing update.');
break;
case CodePush.SyncStatus.UP_TO_DATE:
console.log('[CodePush] App up to date.');
setMessage('App up to date.');
setProgress(false);
break;
case CodePush.SyncStatus.UPDATE_IGNORED:
console.log('[CodePush] Update cancelled by user.');
setMessage('Update cancelled by user.');
setProgress(false);

break;
case CodePush.SyncStatus.UPDATE_INSTALLED:
console.log(
'[CodePush] Update installed and will be applied on restart.',
);
setMessage('Update installed and will be applied on restart.');
setProgress(false);
break;
case CodePush.SyncStatus.UNKNOWN_ERROR:
console.log('An unknown error occurred.');
setMessage('An unknown error occurred.');
setProgress(false);
break;
}
};

const codePushDownloadDidProgress = (progress: DownloadProgress) => {
console.log('codePushDownloadDidProgress ::: ' + JSON.stringify(progress));
};

useEffect(() => {
const syncCodePushImmediate = async () => {
try {
const result = await CodePush.sync(
codePushOptions,
codePushStatusDidChange,
codePushDownloadDidProgress,
);
console.log('result :::::' + result);
} catch (error) {
console.log('syncCodePushImmediate error ::::;' + error);
}
};
syncCodePushImmediate();
}, []);

return { progress, message };
};
728x90
반응형
728x90
반응형

apple Oauth 를 하는 과정에서 com.apple.AuthenticationServices.Authorization Error Code 1000 란 에러가 발생했다.

 

xcode 에서, sign with apple 추가해주면 해결

728x90
반응형
728x90
반응형

Podfile 에

 


pod 'Firebase', :modular_headers => true
pod 'FirebaseCoreInternal', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true

추가로 해결

728x90
반응형
728x90
반응형

edit scheme -> pre-action 

# Type a script or drag a script file from your workspace to insert its path.

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"

echo ".env.development" > /tmp/envfile

 

밑에

touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

 

추가

 

최종

 

# Type a script or drag a script file from your workspace to insert its path.

cp "${PROJECT_DIR}/../.env.development" "${PROJECT_DIR}/../.env"

echo ".env.development" > /tmp/envfile

touch "${PROJECT_DIR}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildDotenvConfig.rb"

728x90
반응형

+ Recent posts