安卓开发常用知识点& 安卓开发常见问题及解决方案,2024年最新java内存面试题

        hasNavigationBar = rs.getBoolean(id);

    }

    try {

        Class systemPropertiesClass = Class.forName("android.os.SystemProperties");

        Method m = systemPropertiesClass.getMethod("get", String.class);

        String navBarOverride = (String) m.invoke(systemPropertiesClass, "qemu.hw.mainkeys");

        if ("1".equals(navBarOverride)) {

            hasNavigationBar = false;

        } else if ("0".equals(navBarOverride)) {

            hasNavigationBar = true;

        }

    } catch (Exception e) {

    }

    return hasNavigationBar;

}



*   2,解决popupwindow在7.0以上机型设置居于view下方却盖在了view上面的问题



if (Build.VERSION.SDK_INT < 24) {

            popupWindow.showAsDropDown(v);

        } else {

            int[] location = new int[2];

            v.getLocationOnScreen(location);

            int x = location[0];

            int y = location[1];

            popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, 0, y + v.getHeight());

        }



[]( )常见问题\============

==============================================================================



[]( )一,androidstudio编译相关

================================================================================



### []( )1, Error while Installing APK



解决方案:重新sync按钮编译下gradle就可以了



### []( )2,出现Execution failed for task类的错误



Error:Execution failed for task ‘:app:compileDebugJavaWithJavac’.  

Compilation failed; see the compiler error output for details.



TaskExecutionException: Execution failed for task ‘:app:transformClassesWithAspectTransformForDebug’  

![image.png](https://upload-images.jianshu.io/upload_images/6273713-e0b01267704779f7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)  

**解决方案**:  

首先找到Execution failed for task,然后取到后面的如上面红框里的信息  

在命令行执行  

./gradlew app:transformDexArchiveWithExternalLibsDexMergerForDebug --stacktrace --info  

或者  

./gradlew compileDebugJavaWithJavac --stackstrace  

执行完成以后,搜索‘错误’就可以看到具体错误原因了



或者运行下面然后查看 Caused by的地方  

./gradlew compileDebugSources --stacktrace -info



### []( )3 Could not find support-media-compat.aar



升级android studio到3.3版本,今天checkout到历史tag上运行android项目,死活报错  

之前也有同事遇到过类似的问题: Could not find support-media-compat.aar  

![image.png](https://upload-images.jianshu.io/upload_images/6273713-9c179c82dd45bc75.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)  

最后意外发现是google()仓库位置的问题  

报错配置:



allprojects {

repositories {

    flatDir {

        dirs 'libs'

    }

    jcenter()

    maven { url "https://jitpack.io" }

    maven { url "https://dl.bintray.com/thelasterstar/maven/" }

    maven {

        url "http://maven.aliyun.com/nexus/content/repositories/releases"

    }

    mavenCentral()

    google()

}

configurations.all {

    resolutionStrategy {

        force "com.android.support:appcompat-v7:$supportLibVersion"

    }

}

}




把google()放到第一位即可



allprojects {

repositories {

    google()

    flatDir {

        dirs 'libs'

    }

    jcenter()

    maven { url "https://jitpack.io" }

    maven { url "https://dl.bintray.com/thelasterstar/maven/" }

    maven {

        url "http://maven.aliyun.com/nexus/content/repositories/releases"

    }

    mavenCentral()

}

configurations.all {

    resolutionStrategy {

        force "com.android.support:appcompat-v7:$supportLibVersion"

    }

}

}




### []( )4,could not find com.android.support:appconpat 如下图:



![image.png](https://img-blog.csdnimg.cn/img_convert/e5bf6b5499619905ff83ad1346350f9d.webp?x-oss-process=image/format,png)  

需要在project的build.gradle中allprojects 添加如下配置即可,添加下面代码到第一行。  

maven { url “[https://maven.google.com]( )” }





**自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。**

**深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!**

**因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。**
![img](https://img-blog.csdnimg.cn/img_convert/604c3b643947ea4c25335c1b0533ed0d.jpeg)
![img](https://img-blog.csdnimg.cn/img_convert/798d2e3017e2a05a519852a992efb299.png)
![img](https://img-blog.csdnimg.cn/img_convert/3beacd99e5f89e042ce3e6990abcf5c5.png)
![img](https://img-blog.csdnimg.cn/img_convert/187f67a64eb88ee74d202deb4a93c447.png)
![img](https://img-blog.csdnimg.cn/img_convert/c0e9e6c8fe262e45b77479ee0760f7c4.png)
![img](https://img-blog.csdnimg.cn/img_convert/826cfae943ea76113c8429df90721fb7.png)

**既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!**

**由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新**

**如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注Java)**
![img](https://img-blog.csdnimg.cn/img_convert/24a8d840e57aa018aec01579e1f51e83.jpeg)



# 写在最后

学习技术是一条慢长而艰苦的道路,不能靠一时激情,也不是熬几天几夜就能学好的,必须养成平时努力学习的习惯。所以:贵在坚持!

最后再分享的一些BATJ等大厂20、21年的面试题,把这些技术点整理成了视频和PDF(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,上面只是以图片的形式给大家展示一部分。

![蚂蚁金服三面直击面试官的Redis三连,Redis面试复习大纲在手,不慌](https://img-blog.csdnimg.cn/img_convert/dbf5395e055d86a0bed6bab6282642ff.webp?x-oss-process=image/format,png)

Mybatis面试专题

![蚂蚁金服三面直击面试官的Redis三连,Redis面试复习大纲在手,不慌](https://img-blog.csdnimg.cn/img_convert/2be6b5460291fa2b536fc9ec8a6bc014.webp?x-oss-process=image/format,png)

MySQL面试专题

![蚂蚁金服三面直击面试官的Redis三连,Redis面试复习大纲在手,不慌](https://img-blog.csdnimg.cn/img_convert/a01fbd525b5c760f307a0d182d60a253.webp?x-oss-process=image/format,png)

并发编程面试专题



**一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
![img](https://img-blog.csdnimg.cn/img_convert/46e87b187f59e0ebee607a56f2f7984d.jpeg)

2725564287)]

Mybatis面试专题

[外链图片转存中...(img-fRkIU92Y-1712725564287)]

MySQL面试专题

[外链图片转存中...(img-fTb3P8iA-1712725564287)]

并发编程面试专题



**一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
[外链图片转存中...(img-07kYTiWE-1712725564288)]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值