![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
记录Bug
风华是一指流砂
这个作者很懒,什么都没留下…
展开
-
解决问题 Cause: buildOutput.apkData must not be null
关于AS升级到3.5以上,gradle版本升级到了5.4.1-all的时候,打包会出现Cause: buildOutput.apkData must not be null的错误。网上都是clean project \ rebuild project附上解决视频:https://www.youtube.com/watch?v=BWUFWzG-kag在build apk 最后一...原创 2019-10-25 12:57:00 · 4431 阅读 · 4 评论 -
android.view.ViewGroup$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams
今天在实现动态改变布局的时候,报了个Error仔细去看了下代码,发现自己真的太粗心大意了,记下来,方便日后翻阅。原代码:ll_Pop_Params = ll_pop.getLayoutParams();img_Product_Params = img_product_large.getLayoutParams();ll_Pop_Params.width = (in原创 2014-04-01 16:11:15 · 2543 阅读 · 0 评论 -
Fragment not attached to Activity
刚在运行项目的时候,报出了这样一个错,定位到的一行代码是加载资源文件。找了找资料,发现是因为Fragment在Activity中加载前就已经调用了获取资源的方法,通过查看Framgent的代码发现:isAdded()Return true if the fragment is currently added to its activity.所以只要在加载资源前加入这个判断就可以了:原创 2015-06-05 18:05:39 · 449 阅读 · 0 评论 -
WebView中addJavascriptInterface不起作用解决方法
private class AndroidBridge { Context mContext; AndroidBridge(Context context) { this.mContext = context; } @JavascriptInterface public void goMarket() { Intent in原创 2015-10-08 19:41:29 · 2249 阅读 · 0 评论 -
java.lang.NoSuchMethodError:android.content.Context.getDrawable
在开发过程遇到需要在TextView上显示文字+图片。因为数据返回是 这类格式的。所以。CharSequence charSequence = Html.fromHtml(html, new Html.ImageGetter() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public Draw原创 2015-10-14 19:55:39 · 5818 阅读 · 1 评论 -
[随手记]Android Studio 上引用Google APIs SDK
转帖请注明原出处:从香港过来一个项目,迁徙到Android Studiuo上的时候,一直报地图页面的 java.lang.incompatibleclasschangeerror 想来想去,应该是包不兼容的原因,原本以为,在 build.gradle 里面 compileSdkVersion 19 是对的,甚至去sdk路径下找出来 mps.jar 打进项目也无济于事。最后在 Sta原创 2016-04-19 19:51:51 · 2722 阅读 · 0 评论 -
[随手记]Android import org.apache.commons.codec.binary.Base64
跟后台上传图片时,转BASE64后再用AES加密时。后台使用的是 import org.apache.commons.codec.binary.Base64 包的encodeBase64String.Android 的 Base64 的package 是import android.util.Base64; 只能使用 encodeToString 方法。但是加密出来的数据,跟后台使用原创 2016-03-31 11:21:55 · 14649 阅读 · 1 评论 -
Android 使用OKHttp3请求接口401,返回Authorization Required错误解决
公司项目需要接入香港天文台的天气xml,API是http://xml.weather.gov.hk/V2/需要账号密码,机场那边提供过来之后,发现app内请求会报401,Authorization Required错误。话不多说,直接上代码:OkHttpClient.Builder client = new OkHttpClient.Builder();client.authen原创 2017-10-23 18:27:48 · 13020 阅读 · 0 评论