Android初窥门径

问题1:报错

Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

 

在gradie.properties中添加如下语句即可解决
android.enableAapt2=false
遇到sync报错
The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
不影响程序运行,暂时不理会。

    问题2:

activity_main中design视图不加载。

解决方法:在res下的values文件夹中的styles.xml文件中,在下列标签中加入Base.路径

 

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
即<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
即可解决。

2018/7/22

1、R文件资源丢失,项目build报错。解决方式。修改android.enableAapt2 = true

再build一遍项目,bug解决。

2、去除标题栏,综合博客和各类网站的此类问题,个人解决方法:删除AndroidManifest.xml文件中的android:label标签,

将android:theme标签修改为:

android:theme="@style/Theme.AppCompat.NoActionBar">标题栏成功去除。
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值