xml에서 꺼내 사용할시 

 

?attr/내용 으로 사용

 

ex)

?attr/colorSurface

 

참고:https://material.io/design/color/dark-theme.html#ui-application

반응형

xml

        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:navigationIcon="?attr/homeAsUpIndicator"
            app:title="툴바"
            app:titleCentered="true" />

activity

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        initToolbar()
    }

    private fun initToolbar() {
        setSupportActionBar(binding.toolbar)
    }

    override fun onSupportNavigateUp(): Boolean {
        onBackPressed()
        return true
    }

 

 

actionmenu 안쓰면 onOptionsItemSelected 구현 필요없이 간단하게 가능 

반응형

'android > study' 카테고리의 다른 글

basicwidget  (0) 2018.04.08
layout  (0) 2018.04.08

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 후 

실행 

 

 

 

 

 

참고:

https://stackoverflow.com/questions/64973346/error-flutter-flutter-h-file-not-found-when-flutter-run-on-ios

반응형
bool compareVersion({required String appVersion, required String compareVersion}) {
  bool isNeedUpdate = false;
  List<String> arrX = appVersion.split(".");
  List<String> arrY = compareVersion.split(".");

  int length = max(arrX.length, arrY.length);

  for (int i = 0; i < length; i++) {
    int x, y;

    try {
      x = int.parse(arrX[i]);
    } on Exception {
      x = 0;
    }

    try {
      y = int.parse(arrY[i]);
    } on Exception {
      y = 0;
    }

    if (x > y) {
      //앱버전이큼
      isNeedUpdate = false;
      break;
    } else if (x < y) {
      //비교버전이큼
      isNeedUpdate = true;
      break;
    } else {
      //동일
      isNeedUpdate = false;
    }
  }

  return isNeedUpdate;
}
반응형

mac에서 터미널을 켠 후 

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch

각각 실행 후 

flutter doctor 실행하면 인식된다!

혹시 안된다면 핸드폰 재부팅하면 된다

 

인식은되는데

no devices found with name or id matching 에러가 뜬다면

 

flutter doctor -v  실행

Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.

 

위같은 에러가 뜬다면 핸드폰 재부팅하면 잘된다 

 

추가:

빈번하게 연결잘하고쓰다가 갑자기 안되고 하는데

xcode를 켜놓고 빌드,

선을 다시 꼽아서 빼보고 빌드 ,

앱을 지웠다가 다시 빌드,

안되면 폰을 재부팅,

하면 왠만하면 해결

 

 

참고:https://stackoverflow.com/questions/64303314/flutter-ios-cant-detect-connected-ios-simulator

반응형

'flutter > ios' 카테고리의 다른 글

adb command not found  (0) 2023.02.02
Xcode doesn’t support iPhone’s iOS  (0) 2022.09.22
ios appstore reject 10번이상 리젝맞은 사유 모음  (0) 2021.10.15
수출 규정 관련 문서가 누락됨  (0) 2021.10.12
ios udid 확인방법  (0) 2021.10.05

yaml에 추가 

intl: ^0.17.0

https://pub.dev/packages/intl

 

 

var m = NumberFormat.currency(locale: "ko_KR", symbol: "₩"); 
print(m.format(1000000000000));
//₩1,000,000,000,000

symbol 없으면 나라별단위로 나옴 (ex:KRW)

 

반응형

'flutter > study' 카테고리의 다른 글

firebase dynamiclink 만들기  (0) 2023.03.03
google map 연동  (0) 2022.09.25
flutter 현지화  (0) 2021.07.28
TextField 사용시 바깥부분 터치시 focus 잃게하는방법  (0) 2021.07.28
app 이름 변경  (0) 2021.07.21

 

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage


We noticed that your app requests the user’s consent to access the camera and photos, but doesn’t sufficiently explain the use of the camera and photos in the purpose string.

To help users make informed decisions about how their data is used, permission request alerts need to explain and include an example of how your app will use the requested information.

Next Steps

Please revise the purpose string in your app’s Info.plist file for the camera and photos to explain why your app needs access and include an example of how the user's data will be used.

You can modify your app's Info.plist file using the property list editor in Xcode.

Resources

- See examples of helpful, informative purpose strings.
- Review a list of relevant property list keys.

Please see attached screenshots for details.

(카메라, 사진앨범 권한의 멘트를 수정해야한다 전에는 카메라 권한을 허용해주세요  이렇게썻었는데 왜쓰는지에대한 내용을 추가해서 해결 -> 카메라 권한을 허용해주세요 ,00글을 올릴때 사용됩니다.)

 

============================================================================

Guideline 4.0 - Design


We noticed that several screens of your app were crowded or laid out in a way that made it difficult to use your app.

Next Steps

To resolve this issue, please revise your app to ensure that the content and controls on the screen are easy to read and interact with.

Resources

For more information, please review the following resources on the iOS Developer Center page:

- UI Do's and Don'ts

- iOS Human Interface Guidelines

- UIKit


로그인 디자인때문에 (전에는 삼각형모양의 로그인배치였다.. ) 링크안에 커스텀 로그인 디자인화면 두개중 하나로 바꿔서 문제해결

https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/buttons/

 

============================================================================

Guideline 2.3.3 - Performance - Accurate Metadata


We noticed that your screenshots do not sufficiently show your app in use. Specifically, your 12.9-inch iPad Pro screenshots show an iPhone device frame.

To help users understand your app’s functionality and value, your screenshots should highlight your app's core concept. For example, a gaming app should feature screenshots that capture actual gameplay within the app.

Next Steps

Please revise your screenshots to ensure that they accurately reflect the app in use on the supported devices.

Keep in mind the following requirements:

- Marketing or promotional materials that do not reflect the UI of the app are not appropriate for screenshots.
- The majority of the screenshots should highlight your app's main features and functionality.
- Confirm that your app looks and behaves identically in all languages and on all supported devices.
- Make sure that the screenshots show your app in use on the correct device. For example, iPhone screenshots should be taken on iPhone, not on iPad.

Resources

- To learn more about creating great screenshots for the App Store, see Optimizing Your App Store Product Page.
- To learn more about uploading screenshots, see App Store Connect Help.

소개페이지의 ipad 이미지 테두리가 iphone으로 되어있어서 생기는 문제였다 페이지수 4에서 5으로추가해서 해결

 

============================================================================

Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage


We noticed that after users authenticate their account with Sign in with Apple, they are required to take additional steps before they can access content and features in your app. Specifically:

- Your app requires two-factor authentication after users use Sign in with Apple.

Sign in with Apple is designed to be a self-contained, all-in-one login system. With security features like built-in two-factor authentication, you can remove additional sign-up steps so users can focus on your app's content and features.

Next Steps

To resolve this issue, please revise your app so the user is not required to provide additional information or take unnecessary steps after using Sign in with Apple.

Resources

- Learn more about Data Management with Sign in with Apple.
- See how to contact users with anonymized emails using the Private Email Relay Service.

 

애플로그인 후 핸드폰인증부분인 앱인데 이런 경고가 날라왔다 

바꾼건 없고 답장으로 폰이 인증필수고 필요하단식으로 하니 나중엔 안물어봄 

================================================

Guideline 1.2 - Safety - User Generated Content

앱이 게시글을 올릴수있고 댓글기능이 있다면 

1.이용약관이있어야하고

2.게시글에 대한 신고기능이 있어야하고

3.다른사용자를 차단할수있는 기능이 필수

===================================================

Guideline 2.1 - Information Needed

email로그인이 없고 소셜 로그인만 하는 상황에서 

자꾸 소셜로그인을 할수있는 임시 아이디비번을 달라해서 

첨엔 동영상으로 되는지 확인시키기도하고 카카오아이디비번을 주니 해외라서 안된다 

결국 소셜로그인이 한국꺼라 외국에서 로그인이 힘드니 니들 애플로그인으로 하면 나중에 지워주겠다고 했더니 통과 

 

반응형

처음 배포하려면 

keystore를 생성해야한다

 

window

keytool -genkey -v -keystore c:/Users/USER_NAME/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key -storetype JKS

 

mac 

keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

 

주황색 부분은 key를 위치할 경로로 바꿔주고 

*노란색부분은 추가해줘야 빌드시 에러가 안난다 

(2048은 키 사이즈고  10000은 서명서의 유효기간 )

 

이름과 성을 입력하십시오. : COMPANY

조직 단위 이름을 입력하십시오. : COMPANY

조직 이름을 입력하십시오. : COMPANY

구/군/시 이름을 입력하십시오? : Seoul

시/도 이름을 입력하십시오. : Seoul

이 조직의 두 자리 국가 코드를 입력하십시오 : KR

 

마지막에 y눌르고 엔터치고 비번한번더 입력하면 원하는경로에 key생성된다

 

 

 

그 키를 

android - app 단위안에 넣는다 

 

 

keystore 참조 

android 폴더안에 key.properties 생성

storePassword=비밀번호
keyPassword=비밀번호
keyAlias=key
storeFile=./key.jks

 

 

 

proguard 설정

android-app내에 proguard-rules.pro 생성

## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-dontwarn io.flutter.embedding.**

 

build gradle 셋팅

android 위에다가 추가 

   def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }

   android {

 

buildTypes 부분에 signingConfigs.debug 를 release로 변경 후 아래 내용 추가 

*useProguard true빼야함 넣으면 에러남 업데이트됨 

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release

            minifyEnabled true
            //useProguard true *넣으면 에러남 업데이트됨 빼야함
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

아랫부분 android 안에 추가 

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }

이런모양

 

이제 terminal에 

flutter build appbundle 
flutter build apk

or 

android studio에서 

 

 

bundle,apk 선택해서 만들면 

해당 경로에 파일이 있다  (flutter 프로젝트 위치 내의 경로)

 

 

 

 

참고 : https://flutter-ko.dev/docs/deployment/android

https://asufi.tistory.com/entry/Flutter-Flutter-%EC%95%B1-%EC%B6%9C%EC%8B%9C-%ED%95%98%EA%B8%B0-release-build-apk-1

반응형

'flutter > android' 카테고리의 다른 글

firebase setting(android)  (0) 2021.07.25

testflight 업로드했는데 경고문이뜨면서 이렇게 뜬다면 일일히 체크해줘야하는 불편함이 있다

 

이럴때 

 

xcode Runner - Runner - Info.plist 파일에 

<key>ITSAppUsesNonExemptEncryption</key>
<false/>

추가하면 된다

반응형

xcode 연다 -> 메뉴 window -> Devices and Simulators 클릭 ->

직접연결했으면 device에 시뮬레이터면 탭 Simulators 클릭 -> 구동시킨 기종을 누르면  identifier 이 udid 이다 

반응형

+ Recent posts