草庐IT

java - 安卓java.io.IOException : write failed: EBADF (Bad file number)

我已经阅读了几篇关于EBADF错误的帖子,但没有解决我的问题。使我的案例与众不同的是我正在尝试写入getFilesDir,它应该可由应用程序写入。我在执行加密方法时收到EBADF错误。文件参数是使用以下方法创建的:newFile(mContext.getFilesDir(),"file.dat")加密方法列表在哪里:publicstaticvoidencrypt(Filefile,Stringpassword,Listobjects){byte[]salt=generateSalt();byte[]iv=generateIV();Cipherc=createCipher(passwor

android - 加密异常 : Bad PKCS7 padding

我看到一小部分生产用户随机报告了这个与使用Xamarin.Android加密/解密字符串相关的异常,但不幸的是我无法重现它。什么可能导致这种情况和/或我如何重现异常以便找出修复/解决方法?[CryptographicException:BadPKCS7padding.Invalidlength147.]Mono.Security.Cryptography.SymmetricTransform.ThrowBadPaddingException(PaddingModepadding,Int32length,Int32position):0Mono.Security.Cryptography

Android Studio,9 补丁和 "Show Bad Patches"按钮。它怎么知道?

我正在尝试清理一个包含大量9-patch图像(50个左右)的大型项目。我发现的一件事是,当一个android项目从Eclipse迁移到AndroidStudio时,系统会查看9个补丁镜像以确保它们符合标准。而且我遇到了很多gradle错误。我见过的关于9补丁的最佳描述是simpleguidetoninepatch.AndroidStudio包含一个9补丁编辑器工具。正是使用该工具将我带到了这里。该工具有一个按钮可以切换“显示坏补丁/隐藏坏补丁”。我在努力理解“坏补丁”的概念。引用:Androiddocument,describingtheuseofthatbutton.Showbadp

Socket Connect 上的 Android 2.2 和 "Bad address family"

我有一个相当简单的游戏,可以在2.1之前的每个版本上完美运行,但是随着新的2.2(Froyo)版本的发布,我无法创建插槽。我正在为nio使用mina包,并得到这个异常:W/System.err(263):java.net.SocketException:BadaddressfamilyW/System.err(263):atorg.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(NativeMethod)W/System.err(263):atorg.apache.harmo

android - E/libEGL : validate_display:255 error 3008 (EGL_BAD_DISPLAY) on Nexus 9 + Android 6

我正在将Cordova3.4中的旧大型应用程序从Eclipse移植到AndroidStudio,因为该应用程序使用的库现已在Android6中更新。在build.gradle和settings.gradle出现一些问题后,应用程序构建、运行,我可以制作apk。在搭载Android5的设备上一切正常。在Nexus9上使用Android6时,应用程序崩溃,出现白屏并出现以下错误:E/libEGL:validate_display:255error3008(EGL_BAD_DISPLAY)在Internet上我找不到这个问题的答案,我尝试处理图像分辨率,但问题没有解决。本帖Error“val

Android 有时我得到 android.app.RemoteServiceException : Bad notification posted from package. 为什么?

我的通知有一个严重的问题。有时,当我的应用发布相同的自定义通知时,我会收到此错误:android.app.RemoteServiceException:Badnotificationpostedfrompackagecom.packagename:Couldn'texpandRemoteViewsfor:ClassName(package=com.packagenameid=0tag=nullnotification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x22))atandroid.app.ActivityT

Android 模拟器错误:std::bad_alloc

我正在使用EclipseJuno和Android模拟器(SDKTools21.1),我多次遇到此错误(好吧,6小时内有两到三次):[2013-03-2211:41:19-Emulator]terminatecalledafterthrowinganinstanceof'std::bad_alloc'[2013-03-2211:41:19-Emulator]what():std::bad_alloc[2013-03-2211:41:19-Emulator][2013-03-2211:41:19-Emulator]ThisapplicationhasrequestedtheRuntimet

android - Android Studio 模拟器报错 "EGL_BAD_MATCH"

我有一个问题,那是什么?E/EGL_emulation:tid3912:eglSurfaceAttrib(1146):error0x3009(EGL_BAD_MATCH)我应该怎么做才能解决该错误?publicclassMainextendsAppCompatActivity{publicTextViewscore;publicImageViewalergator1;publicImageViewalergator2;publicFrameLayoutframe;publicintscoreINT;publicfloatframeHigh;publicfloatframeWidh;pu

android - 读取失败 : EBADF (Bad file number)

当我尝试将外部存储的一个文件复制到文件夹数据库时,会发生此错误:java.io.IOException:readfailed:EBADF(Badfilenumber)这个错误发生在这个方法的while行privatevoidcopiarBaseDados(InputStreaminput)throwsIOException{OutputStreamoutput=newFileOutputStream(ConfiguracoesBaseDados.BANCO_PATH+ConfiguracoesBaseDados.BANCO_NOME);inttamanho;byte[]buffer=n

android - 为什么 AudioRecord.getMinBufferSize 会返回 ERROR_BAD_VALUE (-2)?

我正在三星GalaxySi9000上对此进行测试。intsampleRate=44100;intbufferSize=AudioRecord.getMinBufferSize(sampleRate,AudioFormat.CHANNEL_IN_MONO,AudioFormat.ENCODING_PCM_8BIT);它返回-2ERROR_BAD_VALUE。native采样率为44100Hz,由返回AudioTrack.getNativeOutputSampleRate(AudioManager.STREAM_SYSTEM).我尝试将采样率设置为1000、8000、22100和44100