android开发问题总结

1 AndroidManifest.xml 中 设置屏幕只能竖屏显示

    android:name=".CameraActivity_Click_IsValid_SaveOne"
   
android:theme="@style/Theme.AppCompat.NoActionBar"
   
android:screenOrientation = "portrait"/>

android:layout_width="match_parent"

    android:layout_height="wrap_content"

    android:orientation="vertical"

2 gradle同步失败,不能下载下来

解决方法:找到网址手动下载下来gradle-3.3-all.zip, 直接将压缩包放到

C:\Users\user_name\.gradle\wrapper\dists\gradle-3.3-all\55gk2rcmfc6p2dg9u9ohc3hw9\gradle-3.3-all.zip下。保留原有的gradle-3.3-all.zip.lck,gradle-3.3-all.zip.ok, gradle-3.3-all.zip.part,重启android studio即可( 自动构建gradle时会自动解压zip文件。)

 

3 Android Studio报错:all packages are not available for download package id sources android-28

解决方法:禁用http proxy和Instant run. 

关闭proxy的问题(File -> setting-> Appearance & behavior -> system setting->http proxy->no proxy)

关闭instant run:(File -> setting-> Build,Execution,Deployment -> instant run)

ref: https://blog.csdn.net/tanmx219/article/details/81315736

你可能感兴趣的:(环境配置,android)