Android Studio开发带Custom Chrome Tab的应用安装后无法打开
问题
我使用Android Studio开发了一款适配自有网站、集成Custom Chrome Tab的应用,构建调试版和签名发布版APK后,安装后均无法打开。此前参考过Stack Overflow上的相关问题,但对应的解决方案并不适用于我的情况。
相关代码
核心逻辑代码
public class AnnaStudio { String url = "https://www.example.com/"; CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(); CustomTabsIntent customTabsIntent = builder.build(); customTabsIntent.launchUrl(this, Uri.parse(url)); }
项目配置代码(build.gradle)
plugins { id 'com.android.application' } android { namespace 'com.example' compileSdk 33 defaultConfig { applicationId "com.example" minSdk 24 targetSdk 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation "androidx.browser:browser:1.4.0" implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.8.0' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' }
错误截图

内容的提问来源于stack exchange,提问作者Alex Montsarj
相关产品推荐
相关产品推荐

