Android Studio记录在使用过程遇到的各种问题及解决,2021大厂Android开发面试总结+解答

本文记录了在使用Android Studio过程中遇到的问题,包括gradle配置、错误解决、Eclipse项目导入问题、编译错误、混淆问题等,并分享了实用的Android Studio插件。同时,文章还提及了2021年大厂Android开发面试的重点和常见问题。
摘要由CSDN通过智能技术生成

classpath ‘com.neenbedankt.gradle.plugins:android-apt:x.x’

classpath ‘me.tatarka:gradle-retrolambda:x.x.x’

在module的build.gradle中删除

apply plugin: ‘com.neenbedankt.android-apt’

apply plugin: ‘me.tatarka.retrolambda’

将module的build.gradle文件中的dependency改为

annotationProcessor ‘com.jakewharton:butterknife-compiler:x.x.x’

根据我在网上查找的apt问题,大多都是这样解决

(3)还有个是我个人没有遇到但是在网上有看到没有尝试过的问题

问题描述是:

Error:CreateProcess error=216, 该版本的 %1 与您运行的 Windows 版本不兼容。请查看计算机的系统信息,了解是否需要 x86 (32 位)或 x64

解决方法:

导入的Project项目工程所用的JDK和本地配置的JDK版本不一致所造成的,所以只要将导入的Project的JDK替换成本地的JDK就可以了

步骤 file —> Project Structure —> JDK location —> 选择电脑配置的Java jdk路径

(4)补充eclipse项目导入经常出的错

1.sdk版本不对

2.build.gradle出错

这两个问题方法和上面类似

3.然后是图片格式的问题

.png报错 因为Eclipse对图片的要求不严谨。原jpg改后缀

解决1 改回后缀,.jp

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
H5做的商城客户端,效果和android原生客户端没多大区别,现在h5是越来越火了, android的小伙伴们又遇到一个新的挑战了。本项目只能学习一下WebViewActivity使用, 但是由于js看不到,所以补发看到里面的方法, 主要代码: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_webview); ButterKnife.bind(this); String url = getIntent().getStringExtra(EXTRA_URL); mWebView.setWebViewClient(new WebViewClient()); WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); mWebView.loadUrl(url); setupActionBar(url); } 还有就是CustomTabActivityHelper类封装了 /** * Opens the URL on a Custom Tab if possible. Otherwise fallsback to opening it on a WebView * * @param activity The host activity * @param customTabsIntent a CustomTabsIntent to be used if Custom Tabs is available * @param uri the Uri to be opened * @param fallback a CustomTabFallback to be used if Custom Tabs is not available */ public static void openCustomTab(Activity activity, CustomTabsIntent customTabsIntent, Uri uri, CustomTabFallback fallback) { String packageName = CustomTabsHelper.getPackageNameToUse(activity); //If we cant find a package name, it means there's no browser that supports //Chrome Custom Tabs installed. So, we fallback to the webview if (packageName == null) { if (fallback != null) { fallback.openUri(activity, uri); } } else { customTabsIntent.intent.setPackage(packageName); customTabsIntent.launchUrl(activity, uri); } } /** * Unbinds the Activity from the Custom Tabs Service * @param activity the activity that is connected to the service */ public void unbindCustomTabsService(Activity activity) { if (mConnection == null) return; activity.unbindService(mConnection); mClient = null; mCustomTabsSession = null; }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值