problems encountered
Use Android Studio Electric Eel | 2022.1.1 version to create a new Demo, USB real machine debugging report: INSTALL_FAILED_TEST_ONLY
According to past experience, immediately add to the gradle.properties of the root directory:
android.injected.testOnly=false
After adding and running, it still doesn't work, but after thinking about the old version of Android Studio, why the new version can't work, it must be a configuration problem, and it turns out that it is a gradle version problem? Just tried to change the gradle version, and then run it again.
The default configuration of build.gradle in my root directory is as follows:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.4.0' apply false
id 'com.android.library' version '7.4.0' apply false
}
The default gradle>wrapper>gradle-wrapper.properties configuration is as follows:
#Thu Feb 09 16:39:18 CST 2023distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
solution
Modify the build.gradle version configuration in the root directory to 7.3.0:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
}
As long as the version is less than 7.4.0, if the version is too low, the wrapper.properties configuration should be modified together