Problems encountered in upgrading Android Studio from 2.2.3 to 3.0.1

During the meeting yesterday, the leader suddenly said "the project has stopped developing", and the project that has been working for nearly a year ended in a hurry. There is still more than a month before the Chinese New Year, so nothing will happen. There is nothing left or right, let's upgrade AS. (Added on 2018-01-15: The blog I just saw https://www.jianshu.com/p/15afb8234d19 )

In the development stage, the version used by AS is 2.2.3. The upgrade made me forget to use the Help-->Check for update of AS to directly upgrade, so I uninstalled the AS first, and then downloaded the exe file from the AS Chinese community to install it. Tucao yourself, too low.

As a result, the version I installed was AS 3.0. Then encountered the following problem:

1. When gradle is packaged, the custom apk name reports an error: Cannot set the value of read-only property 'outputFile'

The solution is as follows:


2、AAPT编译报错:Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Solution:

Turn off AAPT2 compilation in gradle.properties file: android.enableAapt2=false


3、apt插件问题(Error:Cannot choose between the following configurations of project :mylibrary:)

Solution:

Processing of my own project:

This is added before because when using butterknife, the obtained control will report a null pointer exception. After upgrading to 3.0.1, it is removed here, and the test is no problem.


4. As mentioned earlier, I first upgraded AS 3.0, so after the first three problems were solved, I encountered the fourth problem:

All kinds of Baidu, SO, etc. all say that they need to add maven{url.......} or google(), but it is useless. Finally, it was upgraded again and upgraded to AS 3.0.1 from Help--->Check for update.

OK, problem solved. It turns out that the version of the classpath 'com.android.tools.build:gradle:3.0.1' under the original project must be the same as the AS version.

5、Annotation processors must be explicitly declared now:

Solution:


6. Signature Version Two signature methods for Android project packaging :

V1 (Jar Signature): Traditional general method. from JDK.
V2 (Full APK Signature): The new way introduced by Android 7.0. Faster installation and more secure verification methods. Not applicable to older Android versions and not mandatory. For complete information, please refer to

Android 7.0 developer version, so in order to pursue a more perfect play, both ticks should be ticked at the same time. If V1 is not checked, the old Android version cannot be installed; if V2 is not checked, the

Android 7.0 devices have abandoned the faster and safer way.

7. When the debug test package is installed, it will prompt : install_failed_test_only .     That is to say, as long as you are in Android Studio 3.0, click the green triangle to run Run, and the apk that comes out must be TEST_ONLY

Hope it is useful to everyone.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325902264&siteId=291194637