invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
630 stars 122 forks source link

[🐛] [App Crash] googleMobileAds/internal-error #395

Closed tndus77 closed 11 months ago

tndus77 commented 1 year ago

What happened?

Hello. Our app is using this library and Apollo/client in react native. Our user are experiencing below error. We don’t know the cause. Help me, please!

  1. "[googleMobileAds/internal-error] Unable to obtain a JavascriptEngine”
  2. [googleMobileAds/network-error] Network error.
  3. [googleMobileAds/no-fill] No fill.
  4. [googleMobileAds/internal-error] Error while connecting to ad server: Unable to resolve host "googleads.g.doubleclick.net": No address associated with hostname
  5. [googleMobileAds/internal-error] Error while connecting to ad server: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
  6. [googleMobileAds/internal-error] Error while connecting to ad server: SSL handshake aborted: ssl=0xb4000074eb85e158: I/O error during system call, Connection reset by peer

Why is this happening?

Platforms

Android and iOS

React Native Info

System:
    OS: macOS 12.5
    CPU: (8) arm64 Apple M1
    Memory: 147.05 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.4.0 - /opt/homebrew/bin/npm
    Watchman: 2023.05.08.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.2 AI-222.4459.24.2221.10121639
    Xcode: 14.1/14B47b - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.8 => 0.71.8 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Are your using Typescript?

package.json

{
  "name": "roubit",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "check_user_alarm_simply": "ts-node ./src/utils/script/alarm/script.ts",
    "combine_lang": "node src/lang/combine_lang.js",
    "check_all_lang_key_match_each_other": "node src/lang/check_all_lang_key_match_each_other.js",
    "make_lang_type": "node src/lang/type-maker.js ./lang.ko.json ./LangType.ts",
    "do_all_lang_process": "yarn combine_lang && yarn check_all_lang_key_match_each_other && yarn make_lang_type",
    "apply_lang_data__famous_saying": "node src/lang/data/local-famous-saying/apply_lang_data__famous_saying.js",
    "apply_lang_data__fortune_cookie": "node src/lang/data/local-fortune-cookie/apply_lang_data__fortune_cookie.js",
    "apply_lang_data__recommend_routine": "node src/lang/data/local-recommend-routine-n-set/apply_lang_data__recommend_routine.js",
    "apply_lang_data__roubisy_saying": "node src/lang/data/local-roubisy-saying/apply_lang_data__roubisy_saying.js",
    "apply_lang_data__store": "node src/lang/data/local-store-item/apply_lang_data__store.js",
    "apply_lang_data__ui": "node src/lang/data/local-ui/apply_lang_data__ui.js",
    "apply_lang_data__all": "yarn apply_lang_data__famous_saying && yarn apply_lang_data__fortune_cookie && yarn apply_lang_data__recommend_routine && yarn apply_lang_data__roubisy_saying && yarn apply_lang_data__store && yarn apply_lang_data__ui && yarn apply_lang_data__ui",
    "___DIVISION_1___": "___",
    "fastlane:aos": "rm -rf ./app/build && fastlane playStore && fastlane firebase_aab && rm -rf ./app/build && ./gradlew app:assembleRelease && fastlane firebase_apk",
    "fastlane:ios": "fastlane testFlight",
    "___DIVISION_2___": "___",
    "git-add-ssh": "eval \"$(ssh-agent -s)\" && ssh-add ~/.ssh/id_rsa",
    "u": "git remote update",
    "p_dev": "git push origin dev",
    "p_s3dh": "git push origin sprint-q2s3-dh",
    "p_merge": "git merge origin/sprint-q2s3.5-dh",
    "hardClear1": "rm -rf ~/Library/Developer/Xcode/DerivedData/*",
    "hardClear2": "watchman watch-del-all && rm -rf node_modules ios/Pods ios/Podfile.lock package-lock.json yarn.lock android/app/build",
    "ipi_b": "yarn install && yarn pod_m1 && yarn ios13",
    "resetCache": "npx react-native start --reset-cache",
    "upload": "ios/Pods/FirebaseCrashlytics/upload-symbols -gsp ios/GoogleService-Info-Prod.plist -p ios ~/Downloads/appDsyms",
    "pod": "cd ios && pod install && cd ..",
    "pod_m1": "cd ios && arch -x86_64 pod install && cd ..",
    "pod_m1_update": "cd ios && arch -x86_64 pod install --repo-update && cd ..",
    "pod_m1_update_2": "cd ios && arch -x86_64 pod repo update && cd ..",
    "codegen": "graphql-codegen --config codegen.yml",
    "a": "yarn source && npx react-native run-android",
    "android": "npx react-native run-android",
    "androidr": "npx react-native run-android --variant=release",
    "androidw": "npx react-native run-android warning-mode=all",
    "d": "adb devices",
    "ios": "npx react-native run-ios",
    "ios8": "npx react-native run-ios --simulator=\"iPhone 8\"",
    "ios12": "npx react-native run-ios --simulator=\"iPhone 12\"",
    "ios13": "npx react-native run-ios --simulator=\"iPhone 13\"",
    "device": "npx react-native run-ios --device=\"Dahee의 iPhone7\"",
    "deviceSE": "npx react-native run-ios --device=\"Dahee의 iPhoneSE\"",
    "test": "jest",
    "lint_origin": "eslint .",
    "lint": "yarn tsc && eslint --ext .tsx --ext .ts src/",
    "lintFix": "npx eslint ./src/**/*.tsx --fix",
    "format": "prettier --check ./src",
    "formatFix": "npx prettier --write ./src",
    "allLint": "yarn lint && yarn format",
    "allFix": "yarn lintFix && yarn formatFix",
    "source": "source ~/.bash_profile",
    "key": "adb shell input keyevent 82",
    "reverse": "adb reverse tcp:3000 tcp:3000",
    "postinstall": "patch-package && rndebugger-open",
    "start": "react-native start",
    "firebase-debug-start": "adb shell setprop debug.firebase.analytics.app com.roubit",
    "firebase-debug-stop": "adb shell setprop debug.firebase.analytics.app .none.",
    "build:ios": "npx react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'",
    "bundle:android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle",
    "r:aos": "./gradlew clean && ./gradlew bundleRelease && ./gradlew app:assembleRelease",
    "image": "npx react-native-fix-image",
    "patch": "patch-package",
    "iosImage": "open /Users/daheeahn/Desktop/d_roubit_app/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m",
    "openPush": "open /Users/daheeahn/Desktop/d_roubit_app/node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java && open /Users/daheeahn/Desktop/roubit_app_desktop/___check-push.js",
    "linting": "npx eslint --ext .tsx --ext .ts src/",
    "fixLinting": "npx eslint --ext .tsx --ext .ts src/ --fix",
    "scrcpy": "scrcpy",
    "codepush:key:android": "appcenter codepush deployment list -a daheeahn/roubit-android-2 -k",
    "codepush:key:ios": "appcenter codepush deployment list -a daheeahn/roubit-ios-2 -k",
    "codepush:release:android": "appcenter codepush release-react -a daheeahn/roubit-android-2 -d Staging -t",
    "codepush:release:ios": "appcenter codepush release-react -a daheeahn/roubit-ios-2 -d Staging -t",
    "codepush:list:android": "appcenter codepush deployment list -a daheeahn/roubit-android-2",
    "codepush:list:ios": "appcenter codepush deployment list -a daheeahn/roubit-ios-2",
    "bundle:analysis:ios": "npx react-native-bundle-visualizer --reset-cache",
    "bundle:analysis:android": "npx react-native-bundle-visualizer --platform android --reset-cache",
    "aos:deeplink:widget1:click": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/my_roubit/main/widget' com.roubit",
    "aos:deeplink:widget2:create": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/create' com.roubit",
    "aos:deeplink:widget2:checkbox": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/routine/1/2022-12-30/checkbox' com.roubit",
    "aos:deeplink:widget2:click": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/routine' com.roubit",
    "aos:deeplink:widget3a:click": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/root-tab/setting-goal-or-dday/a' com.roubit",
    "aos:deeplink:widget3b:click": "adb shell am start -W -a android.intent.action.VIEW -d 'roubitapp://widget/widget/root-tab/setting-goal-or-dday/b' com.roubit"
  },
  "dependencies": {
    "@amplitude/react-native": "^2.7.0",
    "@apollo/client": "^3.7.0",
    "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
    "@babel/plugin-proposal-optional-chaining": "^7.16.7",
    "@babel/plugin-transform-arrow-functions": "^7.16.7",
    "@babel/plugin-transform-shorthand-properties": "^7.16.7",
    "@babel/plugin-transform-template-literals": "^7.16.7",
    "@babel/preset-typescript": "^7.21.5",
    "@gorhom/bottom-sheet": "^4.4.6",
    "@hackler/react-native-sdk": "^3.5.1",
    "@invertase/react-native-apple-authentication": "^2.1.5",
    "@notifee/react-native": "^7.7.1",
    "@react-native-async-storage/async-storage": "^1.18.1",
    "@react-native-camera-roll/camera-roll": "^5.4.0",
    "@react-native-community/art": "1.2.0",
    "@react-native-community/blur": "^4.3.2",
    "@react-native-community/datetimepicker": "7.0.1",
    "@react-native-community/geolocation": "2.0.2",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^9.3.9",
    "@react-native-community/push-notification-ios": "^1.10.1",
    "@react-native-community/slider": "^4.4.2",
    "@react-native-community/toolbar-android": "0.2.1",
    "@react-native-firebase/analytics": "^17.4.3",
    "@react-native-firebase/app": "^17.4.3",
    "@react-native-firebase/auth": "^17.4.3",
    "@react-native-firebase/crashlytics": "^17.4.3",
    "@react-native-firebase/dynamic-links": "^17.4.3",
    "@react-native-firebase/messaging": "^17.4.3",
    "@react-native-firebase/remote-config": "^17.4.3",
    "@react-native-google-signin/google-signin": "^9.0.2",
    "@react-native-seoul/kakao-login": "^5.2.6",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/compat": "^5.3.20",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/native-stack": "^6.6.2",
    "@react-navigation/stack": "^6.0.11",
    "@roubit-develop/roubit-modules": "^1.3.7",
    "@sentry/browser": "5.30.0",
    "@sentry/react-native": "1.9.0",
    "@sentry/tracing": "5.30.0",
    "@types/lodash": "^4.14.181",
    "@types/react-native-mail": "3.0.0",
    "@types/react-native-push-notification": "^8.1.0",
    "@types/react-native-share": "^3.3.3",
    "@types/react-native-snap-carousel": "3.8.2",
    "aws-sdk": "^2.1108.0",
    "axios": "^0.27.2",
    "base64-arraybuffer": "^1.0.2",
    "d3-shape": "1.3.7",
    "date-time-format-timezone": "^1.0.22",
    "dayjs": "^1.11.5",
    "deprecated-react-native-prop-types": "^4.1.0",
    "faker": "5.3.1",
    "global": "^4.4.0",
    "graphql": "^16.6.0",
    "graphql-tag": "2.11.0",
    "i18next": "^21.8.11",
    "ios-deploy": "1.11.4",
    "jsc-android": "^250230.2.1",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.21",
    "lodash-es": "^4.17.21",
    "lottie-ios": "3.4.0",
    "lottie-react-native": "^5.1.6",
    "metro-config": "^0.66.2",
    "mixpanel-react-native": "^2.2.5",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "react": "18.2.0",
    "react-i18next": "^11.17.3",
    "react-native": "0.71.8",
    "react-native-appsflyer": "^6.5.20",
    "react-native-chart-kit": "5.6.1",
    "react-native-cli": "2.0.1",
    "react-native-code-push": "^8.0.1",
    "react-native-debugger-open": "0.3.25",
    "react-native-device-info": "^8.4.8",
    "react-native-disable-battery-optimizations-android": "1.0.7",
    "react-native-draggable-flatlist": "^4.0.1",
    "react-native-exit-app": "^1.1.0",
    "react-native-fast-image": "8.5.11",
    "react-native-fbsdk-next": "^10.1.0",
    "react-native-fix-image": "2.1.0",
    "react-native-fs": "^2.19.0",
    "react-native-gesture-handler": "^2.10.0",
    "react-native-google-mobile-ads": "11.0.0",
    "react-native-haptic-feedback": "1.11.0",
    "react-native-iap": "^12.10.4",
    "react-native-image-crop-picker": "^0.37.3",
    "react-native-image-picker": "3.1.4",
    "react-native-in-app-review": "^3.2.3",
    "react-native-iphone-x-helper": "1.3.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "2.5.6",
    "react-native-localize": "2.0.1",
    "react-native-mail": "6.0.0",
    "react-native-modal": "^13.0.0",
    "react-native-modal-datetime-picker": "^10.2.0",
    "react-native-nfc-manager": "^3.13.5",
    "react-native-orientation-locker": "^1.5.0",
    "react-native-pager-view": "^5.4.9",
    "react-native-permissions": "3.0.1",
    "react-native-popup-menu": "^0.15.12",
    "react-native-push-notification": "^8.1.1",
    "react-native-reanimated": "^3.1.0",
    "react-native-responsive-screen": "1.4.2",
    "react-native-ringer-mode": "^2.0.0",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.20.0",
    "react-native-shake": "^5.1.1",
    "react-native-share": "^8.2.2",
    "react-native-shared-group-preferences": "^1.1.23",
    "react-native-simple-toast": "1.1.3",
    "react-native-slider": "^0.11.0",
    "react-native-snap-carousel": "4.0.0-beta.6",
    "react-native-sound": "^0.11.2",
    "react-native-splash-screen": "3.2.0",
    "react-native-status-bar-height": "2.6.0",
    "react-native-store-review": "^0.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-swiper": "1.6.0",
    "react-native-system-setting": "1.7.6",
    "react-native-tab-view": "^3.1.1",
    "react-native-vector-icons": "6.7.0",
    "react-native-view-shot": "^3.5.0",
    "react-native-webview": "12.1.0",
    "react-native-widgetkit": "^1.0.9",
    "react-query": "^3.39.3",
    "react-string-format": "^1.0.1",
    "recoil": "^0.7.7",
    "rn-fetch-blob": "^0.12.0",
    "socket.io-client": "^4.6.1",
    "styled-components": "^5.3.3",
    "ts-node": "^10.9.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@graphql-codegen/cli": "^2.3.1",
    "@graphql-codegen/introspection": "^2.1.1",
    "@graphql-codegen/typescript": "^2.4.2",
    "@graphql-codegen/typescript-operations": "^2.2.2",
    "@graphql-codegen/typescript-react-apollo": "^3.2.4",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-native": "0.71.3",
    "@types/react-native-shared-group-preferences": "^1.1.1",
    "@types/react-native-vector-icons": "^6.4.8",
    "@types/react-test-renderer": "^18.0.0",
    "@types/styled-components": "^5.1.20",
    "@types/styled-components-react-native": "^5.1.3",
    "@typescript-eslint/eslint-plugin": "^2.34.0",
    "@typescript-eslint/parser": "^2.34.0",
    "babel-jest": "^29.2.1",
    "babel-plugin-lodash": "^3.3.4",
    "babel-plugin-root-import": "6.6.0",
    "babel-plugin-styled-components": "^1.13.2",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "eslint": "^8.19.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^3.1.2",
    "eslint-plugin-react": "^7.19.0",
    "eslint-plugin-react-hooks": "^3.0.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.73.9",
    "prettier": "^2.4.1",
    "react-native-typescript-transformer": "1.2.13",
    "react-test-renderer": "18.2.0",
    "ts-jest": "25.5.1",
    "typescript": "4.8.4"
  },
  "jest": {
    "preset": "react-native",
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js"
    ],
    "transform": {
      "^.+\\.(js)$": "/node_modules/babel-jest",
      "\\.(ts|tsx)$": "/node_modules/ts-jest/preprocessor.js"
    },
    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
    "testPathIgnorePatterns": [
      "\\.snap$",
      "/node_modules/"
    ],
    "cacheDirectory": ".jest/cache"
  },
  "resolutions": {
    "@types/react": "^17.0.38"
  }
}

app.json

{
  "name": "roubit",
  "displayName": "루빗",
  "react-native-google-mobile-ads": {
    "android_app_id": "ca-app-pub-5693625768006184~6074190891",
    "ios_app_id": "ca-app-pub-5693625768006184~2486299678",
    "sk_ad_network_items": [
      "cstr6suwn9.skadnetwork",
      "4fzdc2evr5.skadnetwork",
      "4pfyvq9l8r.skadnetwork",
      "2fnua5tdw4.skadnetwork",
      "ydx93a7ass.skadnetwork",
      "5a6flpkh64.skadnetwork",
      "p78axxw29g.skadnetwork",
      "v72qych5uu.skadnetwork",
      "ludvb6z3bs.skadnetwork",
      "cp8zw746q7.skadnetwork",
      "c6k4g5qg8m.skadnetwork",
      "s39g8k73mm.skadnetwork",
      "3qy4746246.skadnetwork",
      "3sh42y64q3.skadnetwork",
      "f38h382jlk.skadnetwork",
      "hs6bdukanm.skadnetwork",
      "prcb7njmu6.skadnetwork",
      "v4nxqhlyqp.skadnetwork",
      "wzmmz9fp6w.skadnetwork",
      "yclnxrl5pm.skadnetwork",
      "t38b2kh725.skadnetwork",
      "7ug5zh24hu.skadnetwork",
      "9rd848q2bz.skadnetwork",
      "y5ghdn5j9k.skadnetwork",
      "n6fk4nfna4.skadnetwork",
      "v9wttpbfk9.skadnetwork",
      "n38lu8286q.skadnetwork",
      "47vhws6wlr.skadnetwork",
      "kbd757ywx3.skadnetwork",
      "9t245vhmpl.skadnetwork",
      "a2p9lx4jpn.skadnetwork",
      "22mmun2rn5.skadnetwork",
      "4468km3ulz.skadnetwork",
      "2u9pt9hc89.skadnetwork",
      "8s468mfl3y.skadnetwork",
      "av6w8kgt66.skadnetwork",
      "klf5c3l5u5.skadnetwork",
      "ppxm28t8ap.skadnetwork",
      "424m5254lk.skadnetwork",
      "ecpz2srf59.skadnetwork",
      "uw77j35x4d.skadnetwork",
      "mlmmfzh3r3.skadnetwork",
      "578prtvx9j.skadnetwork",
      "4dzt52r2t5.skadnetwork",
      "gta9lk7p23.skadnetwork",
      "e5fvkxwrpn.skadnetwork",
      "8c4e2ghe7u.skadnetwork",
      "zq492l623r.skadnetwork",
      "3rd42ekr43.skadnetwork",
      "3qcr597p9d.skadnetwork"
    ]
  }
}

ios/Podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# 
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# 
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'roubit' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],

    # Hermes is now enabled by default. Disable by setting this flag to false.
    # Upcoming versions of React Native may rely on get_default_flags(), but
    # we make it explicit here to aid in the React Native upgrade process.
    :hermes_enabled => false,
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'Firebase/Analytics', '10.7.0'
  pod 'Firebase/Crashlytics', '10.7.0'
  pod 'CodePush', :path => '../node_modules/react-native-code-push'

  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-AppTrackingTransparency', :path => "#{permissions_path}/AppTrackingTransparency"
  pod 'Permission-LocationAccuracy', :path => "#{permissions_path}/LocationAccuracy"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways"
  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse"
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreExtension', :modular_headers => true
  pod 'FirebaseInstallations', :modular_headers => true
  pod 'GoogleDataTransport', :modular_headers => true
  pod 'nanopb', :modular_headers => true
  pod 'FirebaseSessions'

  target 'roubitTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    # Add these lines for Xcode 14 builds
    installer.generated_projects.each do |project|
      project.targets.each do |target|
          target.build_configurations.each do |config|
            config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
            config.build_settings["DEVELOPMENT_TEAM"] = "F73S568ST4"
          end
      end
    end
    # End of added lines
  end
end

android/build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "33.0.0"
        minSdkVersion = 24 // 201219 전엔 16, 이후 react-native-image-picker때문에 21로 수정 // 221016 react-native-iap때문에 24로 수정
        compileSdkVersion = 33
        targetSdkVersion = 33
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
        kotlinVersion = '1.6.10'

        googlePlayServicesVersion = "+" // default: "+"
        // firebaseVersion = "5.6.0" // default: "+"
        // supportLibVersion = "28.0.0" // default: 23.1.1 -> 200613 net-info setup 때 주석처리

        // 0613 net-info
        // Remove 'supportLibVersion' property and put specific versions for AndroidX libraries
        androidXCore = "1.0.2"
        // Put here other AndroidX dependencies

        // 201216 인앱결제 iap
        androidXAnnotation = "1.1.0"
        androidXBrowser = "1.0.0"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        // (230513 메모) React Native 0.67.4 -> 0.71.8 업그레이드하면서 allprojects 다 없애야 하는데, 이 2개는 앱에서 따로 추가됐던거라 혹시몰라 남겨둔다. // https://react-native-community.github.io/upgrade-helper/?from=0.67.4&to=0.71.8#RnDiffApp-android-build.gradle
        maven { url 'https://maven.google.com' }
        maven { url 'https://devrepo.kakao.com/nexus/content/groups/public/' }
    }
}

android/app/build.gradle

apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

import com.android.build.OutputFile

/**
 * This is the configuration block to customize your React Native Android app.
 * By default you don't need to apply any configuration, just uncomment the lines you need.
 */
react {
    /* Folders */
    //   The root of your project, i.e. where "package.json" lives. Default is '..'
    // root = file("../")
    //   The folder where the react-native NPM package is. Default is ../node_modules/react-native
    // reactNativeDir = file("../node_modules/react-native")
    //   The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
    // codegenDir = file("../node_modules/react-native-codegen")
    //   The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
    // cliFile = file("../node_modules/react-native/cli.js")

    /* Variants */
    //   The list of variants to that are debuggable. For those we're going to
    //   skip the bundling of the JS bundle and the assets. By default is just 'debug'.
    //   If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
    // debuggableVariants = ["liteDebug", "prodDebug"]

    /* Bundling */
    //   A list containing the node command and its flags. Default is just 'node'.
    // nodeExecutableAndArgs = ["node"]
    //
    //   The command to run when bundling. By default is 'bundle'
    // bundleCommand = "ram-bundle"
    //
    //   The path to the CLI configuration file. Default is empty.
    // bundleConfig = file(../rn-cli.config.js)
    //
    //   The name of the generated asset file containing your JS bundle
    // bundleAssetName = "MyApplication.android.bundle"
    //
    //   The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
    // entryFile = file("../js/MyApplication.android.js")
    //
    //   A list of extra flags to pass to the 'bundle' commands.
    //   See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
    // extraPackagerArgs = []

    /* Hermes Commands */
    //   The hermes compiler command to run. By default it is 'hermesc'
    // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
    //
    //   The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
    // hermesFlags = ["-O", "-output-source-map"]
}

apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

project.ext.vectoricons = [
    iconFontNames: [
        'AntDesign.ttf',
        'Entypo.ttf',
        'EvilIcons.ttf',
        'Feather.ttf',
        'FontAwesome.ttf',
        'FontAwesome5.ttf',
        'Foundation.ttf',
        'MaterialIcons.ttf',
        'MaterialCommunityIcons.ttf',
        'Ionicons.ttf',
        'SimpleLineIcons.ttf',
        'Octicons.ttf',
        'Zocial.ttf',
    ] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

/**
 * Set this to true to create four separate APKs instead of one,
 * one for each native architecture. This is useful if you don't
 * use App Bundles (https://developer.android.com/guide/app-bundle/)
 * and want to have separate APKs to upload to the Play Store.
 */
def enableSeparateBuildPerCPUArchitecture = false

/**
 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
 */
def enableProguardInReleaseBuilds = false

/**
 * The preferred build flavor of JavaScriptCore (JSC)
 *
 * For example, to use the international variant, you can use:
 * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
 *
 * The international variant includes ICU i18n library and necessary data
 * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
 * give correct results when using with locales other than en-US. Note that
 * this variant is about 6MiB larger per architecture than default.
 */
def jscFlavor = 'org.webkit:android-jsc:+'

/**
 * Private function to get the list of Native Architectures you want to build.
 * This reads the value from reactNativeArchitectures in your gradle.properties
 * file and works together with the --active-arch-only flag of react-native run-android.
 */
def reactNativeArchitectures() {
    def value = project.getProperties().get("reactNativeArchitectures")
    return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
    ndkVersion rootProject.ext.ndkVersion
    compileSdkVersion rootProject.ext.compileSdkVersion

    namespace "com.roubit"

    aaptOptions {
        cruncherEnabled = false  
    }
    defaultConfig {
        applicationId "com.roubit"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 330
        versionName "5.8.0"
        multiDexEnabled true
        resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
        missingDimensionStrategy 'store', 'play'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include (*reactNativeArchitectures())
        }
    }
    signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }
    buildFeatures {
        viewBinding true
    }

    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            // Caution! In production, you need to generate your own keystore file.
            // see https://reactnative.dev/docs/signed-apk-android.
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

            /* Add the firebaseCrashlytics extension (by default,
            * it's disabled to improve build speeds) and set
            * nativeSymbolUploadEnabled to true. 이거 추가하면 오류 나네... */
            // firebaseCrashlytics {
            //     nativeSymbolUploadEnabled true
            // }
        }
    }

    // applicationVariants are e.g. debug, release
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            // For each separate APK per architecture, set a unique version code as described here:
            // https://developer.android.com/studio/build/configure-apk-splits.html
            // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
            def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
            def abi = output.getFilter(OutputFile.ABI)
            if (abi != null) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        defaultConfig.versionCode * 1000 + versionCodes.get(abi)
            }

        }
    }
}

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    implementation("com.facebook.react:react-android")
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
    implementation 'androidx.databinding:databinding-runtime:7.1.2'

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }
    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation "com.google.android.material:material:1.3.0"
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    implementation 'com.facebook.fresco:fresco:2.+'
    implementation 'com.facebook.fresco:animated-gif:1.+'
    implementation project(':react-native-code-push')
    implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
    implementation 'com.android.support:multidex:2.0.1'
    implementation 'androidx.work:work-runtime:2.7.1' 
    implementation 'androidx.work:work-runtime-ktx:2.7.0'

    implementation project(':react-native-exit-app')

    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }
    //widget lib
    implementation 'com.google.code.gson:gson:2.10'
//    implementation("androidx.activity:activity-ktx:1.6.1")
//    implementation("androidx.fragment:fragment-ktx:1.5.4")

}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle")
apply plugin: 'org.jetbrains.kotlin.android'; applyNativeModulesAppBuildGradle(project)

android/settings.gradle

rootProject.name = 'roubit'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')
include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':react-native-exit-app', ':app'
project(':react-native-exit-app').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-exit-app/android')

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:targetSandboxVersion="1">

    <uses-feature
        android:name="android.hardware.nfc"
        android:required="false" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.NFC" />
    <uses-permission android:name="com.android.vending.BILLING" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="com.google.android.gms.permission.AD_ID" />
    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> <!-- < Only if you're using GCM or localNotificationSchedule() > -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

    <permission
        android:name="${applicationId}.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> <!-- < Only if you're using GCM or localNotificationSchedule() > -->
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- For Cameraroll -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />

    <application
        android:name=".MainApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:requestLegacyExternalStorage="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup">

        <!-- 위젯 Service -->
        <service
            android:name=".widgets.RoubitRemoteViewsService"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.BIND_REMOTEVIEWS"></service>

        <receiver
            android:label="@string/widget_name3b"
            android:name=".widgets.Widget3bProvider"
            android:exported="true">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget3b_info" />
        </receiver>

        <receiver android:name=".utils.AlarmReceiver"
            android:exported="true">
            <intent-filter>
                <action android:name="roubit.widget.roubisyroom.ALARM_ACTION" />
            </intent-filter>
        </receiver>

        <receiver
            android:label="@string/widget_name1"
            android:name=".widgets.Widget1Provider"
            android:exported="true">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="android.appwidget.action.ACTION_SHOW_MESSAGE" />
                <action android:name="android.appwidget.action.ACTION_NEXT_CHAT" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget1_info" />
        </receiver>
        <receiver
            android:label="@string/widget_name3a"
            android:name=".widgets.Widget3aProvider"
            android:exported="true">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget3a_info" />
        </receiver>
        <receiver
            android:label="@string/widget_name2"
            android:name=".widgets.Widget2Provider"
            android:exported="false">
            <intent-filter>
                <action android:name="roubit.widget.routineortodo.CHECKED_ACTION" />
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
            </intent-filter>

            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/widget2_info" />
        </receiver>

<!--        android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"-->
        <activity
            android:name=".conf.Widget2ConfigureActivity"
            android:exported="false">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".conf.Widget3aConfigureActivity"
            android:exported="false">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <activity
            android:name=".conf.Widget3bConfigureActivity"
            android:exported="false">
            <intent-filter>
                <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
            </intent-filter>
        </activity>

        <!-- 위젯 Service -->
        <!-- aspectRatio는 resizeableActivity가 false여야 함. -->
        <!-- aspectRatio가 수정되었다면 constrants의 cWidth도 수정해줘야 함. -->
        <!--
        2022.01.30 안드로이드 태블릿 임시대응 코드 제거
        android:minAspectRatio="1.8"
        android:resizeableActivity="false"
        -->
        <activity
            android:name=".MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
            android:exported="true"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustPan">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            <!-- deep link -->
            <intent-filter android:label="@string/intent_filter_1">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <data
                    android:host="widget"
                    android:scheme="roubitapp"
                    android:pathPrefix="/widget" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="text/plain" />

                <action android:name="android.nfc.action.TECH_DISCOVERED" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />

                <category android:name="android.intent.category.DEFAULT" />

                <data
                    android:host="ext"
                    android:scheme="vnd.android.nfc" />
                <!-- android:pathPrefix="/yourdomain.com:yourtypename" -->
            </intent-filter>

            <meta-data
                android:name="android.nfc.action.TECH_DISCOVERED"
                android:resource="@xml/nfc_tech_filter" />
        </activity> <!-- kakao -->
        <meta-data
            android:name="com.kakao.sdk.AppKey"
            android:value="@string/kakao_app_key" /> <!-- kakao v3.0.3 -->
        <activity
            android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />

                <!-- Redirect URI: "kakao{NATIVE_APP_KEY}://oauth“ -->
                <data
                    android:host="oauth"
                    android:scheme="kakao6a0433cc67364c7ecb266421161e1a69" />
            </intent-filter>
        </activity> <!-- 220905: Facebook SDK -->
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
        <meta-data
            android:name="com.facebook.sdk.ClientToken"
            android:value="@string/facebook_client_token" />
        <meta-data
            android:name="com.dieam.reactnativepushnotification.notification_channel_name"
            android:value="Roubit Notification Channel" />
        <meta-data
            android:name="com.dieam.reactnativepushnotification.notification_channel_description"
            android:value="Roubit" /> <!-- Change the value to false if you don't want the creation of the default channel -->
        <meta-data
            android:name="com.dieam.reactnativepushnotification.channel_create_default"
            android:value="false" /> <!-- Change the resource name to your App's accent color - or any other color you want -->
        <meta-data
            android:name="com.dieam.reactnativepushnotification.notification_color"
            android:resource="@android:color/white" /> <!-- < Only if you're using GCM or localNotificationSchedule() > -->
        <!-- <receiver -->
        <!-- android:name="com.google.android.gms.gcm.GcmReceiver" -->
        <!-- android:exported="true" -->
        <!-- android:permission="com.google.android.c2dm.permission.SEND" > -->
        <!-- <intent-filter> -->
        <!-- <action android:name="com.google.android.c2dm.intent.RECEIVE" /> -->
        <!-- <category android:name="${applicationId}" /> -->
        <!-- </intent-filter> -->
        <!-- </receiver> -->
        <!-- < Only if you're using GCM or localNotificationSchedule() > -->
        <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
        <receiver
            android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>

        <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService" />
    </application>

</manifest>
github-actions[bot] commented 1 year ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.