【问题标题】:How to make "Choose Destination Directory" dialog appear after "Create Test" in Android Studio如何在 Android Studio 中的“创建测试”之后显示“选择目标目录”对话框
【发布时间】:2022-10-24 14:07:27
【问题描述】:

我正在学习谷歌代码实验室的单元测试。

https://developer.android.com/codelabs/advanced-android-kotlin-training-testing-basics#5

在 AndroidTest/Test 目标对话框中选择文件夹有一个步骤 enter image description here

但是我的 Android Studio 没有显示这个对话框,所以我每次都需要将我的文件拖到测试包中。

如何设置 Android Studio 让这个对话框打开?

【问题讨论】:

    标签: java android-studio unit-testing kotlin


    【解决方案1】:
    1. 更新 gradle 和 android gradle 插件
    2. 更新所有依赖插件(我更喜欢删除gradle变量并使用直接版本号的依赖以避免冲突) 像这样

      实现“org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1”

      1. 更新 kotlin 版本

      2. 将目标 SDK 更新为 33

      3. 将exported = "true" 添加到清单中的MainActivity 标记中

          <activity
            android:name="com.example.android.architecture.blueprints.todoapp.tasks.TasksActivity"
            android:windowSoftInputMode="adjustResize"
            android:exported="true"
            android:theme="@style/AppTheme.OverlapSystemBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-28
      • 1970-01-01
      • 2016-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-18
      相关资源
      最近更新 更多