firebase문제로 이 에러가 발생하였다
firebase_core_platform_interface: 4.5.1이부분을 지우고
firebase desktop 라이브러리 몇개 지우고
업데이트하니 정상작동한다.
업데이트 할수있는 패키지를 찾는다
flutter pub outdated
낮은버전 패키지 모두 업데이트
flutter pub upgrade --major-versions
firebase문제로 이 에러가 발생하였다
firebase_core_platform_interface: 4.5.1이부분을 지우고
firebase desktop 라이브러리 몇개 지우고
업데이트하니 정상작동한다.
업데이트 할수있는 패키지를 찾는다
flutter pub outdated
낮은버전 패키지 모두 업데이트
flutter pub upgrade --major-versions
flutter 작업시 Flutter/Flutter.h 가 없다면서 에러가 뜰때가 있다
(ios-Runner-Info.plist안의 파일을 xcode 외에서 잘못 수정시 h찾을수없다고 나옴) 설정이 망가진듯
이럴때
flutter 터미널에서 cd ios
pod deintegrate
rm Flutter/Flutter.podspec (파일지움)
rm podfile.lock (파일지움)
flutter clean
flutter run
등등 의 해결책들이 안먹힐때
마지막으로
flutter 프로젝트의 파일안에 ios-Runner 폴더을 다른곳에 저장해놓고
ios 폴더 삭제
그리고 프로젝트 안에서 터미널로 (flutter create .) 아니면 (flutter create -i swift .) 하면 ios가 생긴다 (안생긴다면 ios빈 폴더 만들것 , . 필수 )
다시 생기면 runner 폴더를 새로생긴 ios폴더 안에 집어넣는다
xcode로 실행 후 runner의 bundle id ,version 체크
firebase의 service-Info.plist도 새로받아서 넣어줘야 한단다
flutter run 하면 끝
안되면
cd ios
pod install 후
실행
참고:
mac에서 ios 에뮬레이터로 앱 구동시
Warning: CocoaPods not installed. Skipping pod install. 에러가 뜬다면
터미널에 sudo gem install cocoapods 실행
cocoapods를 설치하자
ios구동시 (12 pro max 에뮬)
Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile
에러가 났을때
ios -> Podfile 파일을 열고
platform : ios, '10.0' 주석풀고 10으로 변경
The method 'FallThroughError' isn't defined for the class (0) | 2023.06.26 |
---|---|
Flutter/Flutter.h error (0) | 2021.12.16 |
Warning: CocoaPods not installed. Skipping pod install. (0) | 2021.07.26 |
web 빌드시 Missing index.html 에러 날때 (0) | 2021.07.15 |
flutter Unable to find git in your PATH (0) | 2021.07.03 |
프로젝트르 처음만들거나 낮은버전에서 만들었을때
Terminal 에서
flutter create .
실행 끝
==============================================================
수동
flutter build web 했을때 missing index.html 에러가 날때
폴더 디렉토리에 web이란 폴더 생성 후
file생성으로 index.html 생성하고
아래 내용을 넣은후 실행하면 끝 (프로젝트생성시 web 선택하면 자동생성되는 html코드 title부분수정해야 링크줄때 제목 제대로 나옴)
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
-->
<base href="/">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="get_x_with_youtube">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<title>title</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
var serviceWorkerVersion = null;
var scriptLoaded = false;
function loadMainDartJs() {
if (scriptLoaded) {
return;
}
scriptLoaded = true;
var scriptTag = document.createElement('script');
scriptTag.src = 'main.dart.js';
scriptTag.type = 'application/javascript';
document.body.append(scriptTag);
}
if ('serviceWorker' in navigator) {
// Service workers are supported. Use them.
window.addEventListener('load', function () {
// Wait for registration to finish before dropping the <script> tag.
// Otherwise, the browser will load the script multiple times,
// potentially different versions.
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
navigator.serviceWorker.register(serviceWorkerUrl)
.then((reg) => {
function waitForActivation(serviceWorker) {
serviceWorker.addEventListener('statechange', () => {
if (serviceWorker.state == 'activated') {
console.log('Installed new service worker.');
loadMainDartJs();
}
});
}
if (!reg.active && (reg.installing || reg.waiting)) {
// No active web worker and we have installed or are installing
// one for the first time. Simply wait for it to activate.
waitForActivation(reg.installing ?? reg.waiting);
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
// When the app updates the serviceWorkerVersion changes, so we
// need to ask the service worker to update.
console.log('New service worker available.');
reg.update();
waitForActivation(reg.installing);
} else {
// Existing service worker is still good.
console.log('Loading app from service worker.');
loadMainDartJs();
}
});
// If service worker doesn't succeed in a reasonable amount of time,
// fallback to plaint <script> tag.
setTimeout(() => {
if (!scriptLoaded) {
console.warn(
'Failed to load app from service worker. Falling back to plain <script> tag.',
);
loadMainDartJs();
}
}, 4000);
});
} else {
// Service workers not supported. Just drop the <script> tag.
loadMainDartJs();
}
</script>
</body>
</html>
플러터 설치하구 환경변수 설정시 에러가 난다면 아래 3개가 필수적으로 있는지 확인
C:\Windows\System32 (나는 이게 없어서 안됬었다..)
C:\Program Files\Git\cmd
C:\flutter\bin (flutter 설치경로의 bin)