android - Flutter,url_launcher 在调试模式下工作,但在 apk 中不工作
问题描述
1-颤振,url_launcher 在调试模式下工作,但在 apk 中不工作。2-url_launcher 工作 api 29 但不在 api 30 中工作。我的英语很糟糕,所以我很抱歉。我的主要问题是“Flutter,url_launcher 在调试模式下工作,但不在 apk 下工作”你能帮我吗?
TextButton(onPressed: () async {
print(_gonderi.kanalID);
if(await canLaunch("https://www.youtube.com/channel/" + _gonderi.kanalID)) {//youtubeChannel
await launch("https://www.youtube.com/channel/" + _gonderi.kanalID);//YoutubeChannel
} else {
throw "Bu siteye ulaşılamıyor";
}
}, child: Container(
height: 100,
width: double.infinity,
child: Image.asset("assets/images/aboneOl.png"),
))
安卓/app/src/main/AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.android.vending.BILLING" />
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="https" />
</intent>
<intent>
<action android:name="android.intent.action.DIAL" />
<data android:scheme="tel" />
</intent>
</queries>
安卓/应用程序/buildGradle
android {
compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.IzleKazan"
minSdkVersion 19
targetSdkVersion 29
安卓/buildGradle
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
}
解决方案
推荐阅读
- ios - 将数据从 Firestore 映射到 Swift 中的结构 - IOS
- go - 无需等待流缓冲区刷新即可将数据上传到表
- c++ - 有没有办法检查 QLabel pixmap 是否设置为特定的东西?
- angular - 变量未定义,因为它在 API 调用完成之前被实例化 - Angular 7
- html - 如何为边框底部设置CSS
- c++ - 对 char* 数组元素访问的困惑
- javascript - 一个 div 是 position:fixed 而垂直滚动但 position:relative 而水平滚动?
- dependencies - 提供/必需表示法中的接口之间的 UML 依赖关系
- postgresql - 创建序列时在 AS 整数处或附近出现语法错误
- reactjs - this.props 在 shouldComponentUpdate 运行之前更新