2025-09-24

Ionic + Vue 在使用目錄時的狀況

使用的 Framework 是Ionic + Vue 3.5

我有兩個頁面,原本的 code 如下

<!-- 第一頁 -->

<template>
	<ion-page>
		<ion-header  >
			<ion-toolbar>
				<ion-title><h1>Foo</h1></ion-title>				
			</ion-toolbar>
		</ion-header>
		<ion-content>
			<!-- 中略 -->
		</ion-content>
	</ion-page>
</template>
<!-- 第二頁 -->

<template>
	<ion-menu content-id="main-content">
		<ion-header >
			<ion-toolbar color="tertiary">
				<ion-title>Menu Content</ion-title>
			</ion-toolbar>
			<ion-menu-toggle slot="end">
				<ion-button>Close</ion-button>
			</ion-menu-toggle>
		</ion-header>
		<ion-content class="ion-padding">
			<!-- 中略 -->
		</ion-content>
	</ion-menu>
	<ion-page id="main-content">
		<ion-header>
			<ion-toolbar>
				<ion-buttons slot="start">
					<ion-menu-button></ion-menu-button>
				</ion-buttons>
				<ion-title> BAR </ion-title>
			</ion-toolbar>
		</ion-header> 
		<ion-content class="ion-padding">
			<!-- 中略 -->
		</ion-content>
	</ion-page>
</template>

兩頁的差別在於,第二頁有 <ion-menu/>;第一頁沒有。

這樣的 code ,從第一頁切換到第二頁是正常的

但從第二頁切換回第一頁時,會出現以下錯誤:

  1. <ion-header> 顯示的是第二頁的標題
  2. 第一頁不存在的<ion-menu>依舊存在

2025-09-04

紀錄一下自己接手一個 android app 時遇到的問題

我接手一個 android app,他有使用一個 lib:PageIndicatorview

dependencies {
        implementation 'com.romandanylyk:pageindicatorview:1.0.2'
}

執行 gradlew.bat assembleDebug --warning-mode all 後,會回復以下 2 個錯誤訊息

The RepositoryHandler.jcenter() method has been deprecated. This is scheduled to be removed in Gradle 9.0. JFrog announced JCenter's sunset in February 2021. Use mavenCentral() instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.10.2/userguide/upgrading_version_6.html#jcenter_deprecation
        at build_c0uup8fmroz422c6id7ruwe51$_run_closure1$_closure2.doCall$original(D:\workspace\app\build.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_c0uup8fmroz422c6id7ruwe51$_run_closure1.doCall$original(D:\workspace\app\build.gradle:2)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
WARNING: The option setting 'android.defaults.buildfeatures.buildconfig=true' is deprecated.
The current default is 'false'.
It will be removed in version 9.0 of the Android Gradle plugin.
To keep using this feature, add the following to your module-level build.gradle files:
    android.buildFeatures.buildConfig = true
or from Android Studio, click: `Refactor` > `Migrate BuildConfig to Gradle Build Files`.
> Task :app:checkDebugAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.romandanylyk:pageindicatorview:1.0.2.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/github/romandanylyk/PageIndicatorView/v1.0.2/PageIndicatorView-v1.0.2.pom
       - https://repo.maven.apache.org/maven2/com/github/romandanylyk/PageIndicatorView/v1.0.2/PageIndicatorView-v1.0.2.pom
       - https://jitpack.io/com/github/romandanylyk/PageIndicatorView/v1.0.2/PageIndicatorView-v1.0.2.pom
     Required by:
         project :app