Android程序在ps3模拟器能运行游戏上能运行,在两台真机上能安装但是闪退运行不了,是什么原因?

为什么我写的android程序在模拟器上运行正常但是到了真机上就会终止?_百度知道
为什么我写的android程序在模拟器上运行正常但是到了真机上就会终止?
我有更好的答案
你的程序编写用的android版本和手机android版本是不是一样的或者手机的低于程序的?如果不是,那就把你的程序的android版本改下就可以了。
兼容?写程序时要考虑兼容版本.
能说具体点吗?我刚学android没多久,那个程序在模拟器上运行完全没问题,但是一到我的手机上就会报一些莫名其妙的问题。 然后就停止运行。
因为你的电脑能运行,手机就不一等能允许,电脑还能玩穿越火线呢,手机就不能玩,你的手机不兼容,要看看安卓手机的配置和版本,做程序
1条折叠回答
为您推荐:
其他类似问题
您可能关注的内容
android的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。Android程序在真机上出现闪退,在虚拟机上运行正常怎么解决_百度知道
Android程序在真机上出现闪退,在虚拟机上运行正常怎么解决
我有更好的答案
真机上出现闪退,模拟器上没事,有可能是以下原因:使用到了谷歌的服务框架,而真机是么有的.其他代码问题,比如一些特定的key,需要重新申请之类的
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。android 程序在模拟器上可以运行, 但到了真机上就闪退 , 什么请况 怎么解决, 求解答???
浏览 540回答 3
qq_橘子开花_0
真机的版本比你设的版本高了
你模拟器的Android版本是多少,你手机的版本是多少??
你的app最低兼容的Android版本又是多少?
报什么错啊,就写个这个怎么知道
随时随地看视频我怎么能检测到一个Android应用程序在模拟器上运行吗?
扫码加入我们
我怎么能检测到一个Android应用程序在模拟器上运行吗?
I would like to have my code run slightly differently when running on the emulator than when running on a device. (For example, using 10.0.2.2 instead of a public URL to run against a development server automatically.) What is the best way to detect when an Android application is running in the emulator?
Might have a look at android.os.Build.
日34分18秒
Amaze me... Google should have a standard way of doing this?
日34分18秒
&contains& rather than &startsWith& works on x86 too
日34分18秒
Please state whether a fingerprint containing &generic& is either an emulator or the device. That information is key but not provided.
日34分18秒
Emulator - judging by the comments before yours :)
日34分18秒
This returns true on my devices running CyanogenMod so beware.
日34分18秒
The Android documentation says you shouldn't try to interpret the FINGERPRINT value.
日34分18秒
That's the way Facebook detects emulators in React-Native
日34分18秒
This is what I had to update to after using the answer from Aleadam for quite awhile (it stopped working for me).
日34分18秒
Doesnt work with BlueStacks
日34分18秒
Sid What should be added for it?
日34分18秒
DrDeo You can add a check of the current build using BuildConfig.DEBUG, or create your own build with your own custom variable. You might also be able to use Proguard to make this function always return false, or something (you can remove logs, for example, as shown here: medium.com/tixdo-labs/& , so maybe that's possible too)
日34分18秒
Anyone reading this may be interested to know that this string appears to have changed to 'sdk', rather than 'google_sdk'.
日34分18秒
Daniel: I use 2.3.3 with Google API and it says 'google_sdk'. Seems that it's 'google_sdk' for AVD with Google API and 'sdk' for the normal ones.
日34分18秒
Is this a reliable way to handle this issue. Our servers use the device id and we want to be able to prevent usage of the app on emulators at all costs as the device ID can easily be faked, but I want to make sure that we are not excluding any devices in case there are devices that use &google_sdk& or &sdk&
日34分18秒
The Intel emulator returns &full_x86& so I wouldn't count on this method.
日34分18秒
Including more cases: &google_sdk&.equals(Build.PRODUCT) || &sdk&.equals(Build.PRODUCT) || &sdk_x86&.equals(Build.PRODUCT) || &vbox86p&.equals(Build.PRODUCT)
日34分18秒
Yes. Unlike Build.PRODUCT, Build.HARDWARE (goldfish) is the same for the official SDK and AOSP. Prior to API 8, you have to use reflection to get at the HARDWARE field, however.
日34分18秒
I'd go with isEmulator = Build.HARDWARE.contains(&golfdish&)
日00分03秒
holmes: typo, s/b &goldfish&
日34分18秒
I too ... groups.google.com/forum/#!topic/android-kernel/M4SjXulUeUo
日34分18秒
For the Android 5.1 x86_64 image (and probably other more recent 64bit images) that would be &ranchu& instead of &goldfish&.
日34分18秒
Thank you for this code. I have checked and it is working, aldo coping the long debug key can be painful but it is done only once. This is the only reliable solution, as all other answers compare some part of the OS build info string with a static string, and this can and was changed over Android SDK versions, and also can be forged by custom Android builds.
日34分18秒
I think it is the only reliable solution. However, the debug key can change more quickly than we want.
日34分18秒
A better way to do this is BuildConfig.DEBUG.
日34分18秒
What does a device without a SIM card (such as a tablet) return?
日34分18秒
Running emulator for Android 2.1. This code was working for me, but since upgrading Cordova to 2.7.0, the Context variable appears to be undefined or something. Here's the error I'm getting in ADT: &Context cannot be resolved to a variable.& Also, according to comment above, this is NOT a reliable method (though I haven't actually had it fail myself).
日34分18秒
rds Devices which does not have a SIM card returns empty string (&&)
日34分18秒
It s egal to &sdk& not &google_sdk& on my version
日34分18秒
When running the x86 emulator on Windows, Build.Product is sdk_x86.
日34分18秒
it worked for me .........thnxxxx
日34分18秒
Why not just contains(&sdk&)? The only difference (other than being faster) is that matches(&.*_?sdk_?.*&) requires that if there is a character before or after sdk, it must be an underscore '_', which is not all that important to check.
日34分18秒
This file is on my HTC One, so it doesn'-)
日34分18秒
During startup of the Android system the Linux kernel first calls the process &init&. init reads the files &/init.rc& and &init.device.rc&. &init.device.rc& is device specific, on the virtual device this file is called &init.goldfish.rc&.
日34分18秒
This appears to work from the NDK. Include &sys/system_properties.h& and use __system_property_get(&ro.hardware&, buf) then check that buf is &goldfish&.
日34分18秒
IMEI is likely also to return 0 on an Android tablet, or on a phone without SIM card.
日34分18秒
On my Genymotion running on a mac Build.DEVICE = vbox86p
日34分18秒
I'd be careful with that because of this horrible bug: code.google.com/p/android/issues/detail?id=10603
日00分03秒
the firmware engineer we have in-house didn' getting Build.Manufacturer on our hardware returned &unknown&. The Fingerprint seems like a better way.
日34分18秒
Nice one. init.goldfish.rc only it's additionally a good check going forward in addition to the Build details.
日34分18秒
sud007 There are many devices out there with `/init.goldfish.rc and this will lead to false positives. For example, many Samsung Galaxy series devices.
日34分18秒
laalto you were actually correct. I found that out later and apologies that I forget to update it here.
日34分18秒
^ airpair.com/android/posts/&
日34分18秒
Andy_46.16_48 returns &andy& for Build.HARDWARE
日34分18秒
& 2017 内容协议在写android插件的时候,安卓直接打包运行没问题,打包成jar包后在Unity上运行闪退,请问应该怎么去查找问题
【新手】梦想各位大神请教一个问题,在写android插件的时候,安卓直接打包运行没问题,打包成jar包后在Unity上运行闪退,请问应该怎么去查找问题【中级】光风霁月看日志【新手】梦想闪退没日志【高级】ゼ囨ソ囚囨図占用内存太多&&&把你该释放的释放了【新手】梦想adb&logcat&-s&Unity&我是这样查看日志的,请问你们一般是怎样查看调试日志?【初级】ゞ守護?明天 /包没有打好。【新手】梦想@ゞ守護?明天&/&我只打包src,然后copy&lib&res&main.xml【初级】ゞ守護?明天 /在eclipse调试。【新手】梦想unity打包也没有异常,就是运行闪退,eclipse上直接运行android工程可以正常使用,不知打包的时候还需要有注意点什么请问在eclipse上怎样调试unity的项目【初级】ゞ守護?明天 /用模拟器。【新手】梦想bin下面也要打包么,我以前的项目都知道打包src【初级】ゞ守護?明天 /【新手】梦想【初级】ゞ守護?明天 /bin&下面是.class文件需要打包|!不勾选res【新手】梦想我再试一下libs不用拖到项目吗【初级】ゞ守護?明天 /不用&你在Unity&android目录下面建立一个bin文件夹,将你jar文件放进去!我的是这个目录!【新手】梦想哦哦,你也有添加Libs呀【初级】ゞ守護?明天 /嗯嗯!扔进来就好!【新手】梦想还是闪退!!【初级】ゞ守護?明天 /那就是你java代码有问题了!【高级】大地你的这个文件是不是配错了【新手】梦想但是在eclipse中真机调试很正常【初级】ゞ守護?明天 /有错误日志吗?【新手】梦想没有日志【初级】ゞ守護?明天 /你电脑上安装一个模拟器!打开模拟器调试!【中级】安静式、傷/小纠结/小纠结/小纠结【新手】| ﹃切如旧 unity获取设备经纬度(unity使用GPS)代码附上去以后报错&&&有大神指点一下么?【新手】梦想Unity获取GPS很简单,起一个线程就可以了@|&﹃切如旧&&不过Unity的GPS不太好用,就是退出后台时无法或取GPS,我试过用原生AndroidGPS,但是老是启动不了GPS模式,只能使用network模式,network模式的精准度非常差@@ゞ守護?明天&/请问这是什么意思【新手】| ﹃切如旧 关于U3D上面GPS定位&&&&总是找不到方向&&&&&一般这种定位功能思路的话应该是怎样的?网上找了一些资料&&&&&按着来都最后实现不了&&&&&已经懵了【高级】Global Offensive我这游戏界面摄像机颠倒了是怎么回事啊【高级】名字好厉害的场景
------分隔线----------------------------
赞助商链接
赞助商链接}

我要回帖

更多关于 模拟器运行小程序闪退 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信