Android development error record (1)

1. AndroidStudio installs the application in Debug mode and reports an error: INSTALL_FAILED_TEST_ONLY

http://bbs.coloros.com/data/oppo/2017/12/18/151359263634513417.png

TEST_ONLY means that the version is only used for testing. After checking some information, there is a saying that the compiler version and gradle version used in the project cannot be the alpha version, and the gradle version needs to be reduced. After checking some information on the external network , it is also said to use The alpha version and the instant run function cannot be used in the plug-ins and dependent libraries . I am using Android Studio 3.0.1 version, this situation has been encountered on some oppo phones, and later found that the reason is that AS3.0 will automatically add the android:testOnly="true" attribute in the application tag of the manifest file of the debug apk , The apk that runs out of run in the IDE can only be installed with adb install -r <apk> on most mobile phones, and it cannot even be installed on oppo mobile phones. The solution is: gradle.properties ( or gradle Add android.injected.testOnly=false to the global configuration directory ~/.gradle/) file

2. The plugin cannot be found in Android Studio

打开File -> Settings -> Appearance & Behavior -> System settings -> Updates

Use secure connection (do not check this option, remove the √ in front of this option)

For Android studio 3.1, other versions may also work

3.报错: Activity did not call finish() prior to onResume() completing

Reason: When the Activity has no interface, the style of the Activity needs to be set to be transparent. Otherwise, a crash will occur when logging in on models above 6.0 . The configuration of the wrong activity theme is as follows:

<activity android:name=".DemoActivity"
   android:theme="@android:style/Theme.NoDisplay/>

This is a theme without UI, in order to solve the problem, you only need to change the theme to transparent, ps: remember that transparency does not mean no UI, as shown below:

<activity android:name=".DemoActivity "
    android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

 

Guess you like

Origin blog.csdn.net/gs12software/article/details/96875663
Recommended