首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么android程序不能在我的手机上运行(它可以在虚拟手机上运行)

为什么android程序不能在我的手机上运行(它可以在虚拟手机上运行)
EN

Stack Overflow用户
提问于 2020-02-20 19:43:18
回答 1查看 1.8K关注 0票数 1
代码语言:javascript
运行
复制
 try {
        val adresstext= findViewById(R.id.editText3)as TextView

        fusedLocationClient = LocationServices.getFusedLocationProviderClient(this)
        fusedLocationClient.lastLocation.addOnSuccessListener {
                location -> location

            var locationx=location.longitude
            var locationy=location.latitude

            val name = findViewById(R.id.textView) as TextView
            name.text=(locationx.toString()+" "+locationy.toString())
            var geocoder: Geocoder
            var listadress :List<Address>


            geocoder = Geocoder(this, Locale.getDefault());
            listadress =geocoder.getFromLocation(locationy,locationx,1)
            var adress=listadress[0].getAddressLine(0)
            var city =listadress[0].locality.get(0)
            var state = listadress[0].adminArea.get(0)
            var country = listadress[0].getCountryName()
            var postalCode = listadress[0].getPostalCode()
            var knownName = listadress[0].getFeatureName()
            adresstext.text=(adress+city+state+country+postalCode+knownName)


        }

    }
    catch (e: java.lang.Exception)
    {
        Toast.makeText(this,e.toString(),Toast.LENGTH_LONG).show()
    }

这是我的代码,当ı在模拟器中运行它时,它工作得很好,没有错误,但当我用我的手机(ı连接到我的pc)运行它时,按钮不起作用,它说:

代码语言:javascript
运行
复制
V/AudioManager: querySoundEffectsEnabled...
D/AwareBitmapCacher: handleInit switch not opened pid=19134

在此之前,当程序在我的手机中打开时,run seciton如下:

代码语言:javascript
运行
复制
E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils

E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@6c8edde
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@3bb1bbf

这3个是红色的,我该怎么解决这个问题呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-02-20 20:02:09

您应该转到手机设置并找到您的应用程序。允许Check location服务。如果不允许的话。接受这个事实吧。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60319177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档