Android的工作室 - 部署我的应用程序没有新的变化 [英] Android Studio - Deploys my app without new changes

查看:195
本文介绍了Android的工作室 - 部署我的应用程序没有新的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题基本上是Android的工作室不会与我在新的code改变部署我的应用程序。继承人我的情况:

My problem is basically that Android Studio wont deploy my app with my changes in the new code. Heres my case scenario:

我有一个Wi-Fi直连code这样的工作(只是它的方法测试):

I have a wifi direct code working like this (just testing with its methods):

    public void peerDiscovery(){

    mWifiDirectManager.discoverPeers(mChannel,

      new WifiP2pManager.ActionListener() {
        @Override
        public void onSuccess() {
             Log.v(TAG,"Discovery Peers Success");


        }

        @Override
        public void onFailure(int reason) {
            Log.e(TAG,"Error on Discovery Peers, code: "+reason);


        }
     });
}

以上code ++工程,然后我决定加入方法来改变它:setPeerDiscoveryHandler(布尔isSuccess);

The above code works and then I decided to change it by adding the method: setPeerDiscoveryHandler(boolean isSuccess);

更改我的code如下之后:

After the changes my code was as follows:

 public void peerDiscovery(){

    mWifiDirectManager.discoverPeers(mChannel,
      new WifiP2pManager.ActionListener() {
        @Override
        public void onSuccess() {
            setPeerDiscoveryHandler(true);
            Log.v(TAG, "Message Sent");
        }

        @Override
        public void onFailure(int reason) {
            Log.e(TAG,"Error on Discovery Peers, code: "+reason);
            setPeerDiscoveryHandler(false);
        }
    });
}

但你猜怎么着,甚至在做这个新的code和点击运行按钮后,就好像我没有做什么!我意识到发生了什么后,我开始检查我的logcat和消息:

But guess what, even after doing this new code and clicking on the Run button, it was like I didnt do nothing! And I realized that was happening after I started to check my logcat and the message:

发现同行的成功

正在打印,但我有它从code删除(因为你可以在我的新code看到的)。我试图重建和清理项目,再次部署之前卸载从移动应用,但似乎没有生效。它有什么想法?

was being printed, but I had it removed from the code (as you can see in my new code). I tried to rebuild and clean the project, uninstall the application from the mobile before deploying it again, but nothing seems to take effect. Any thoughts about it ?

在此先感谢所有帮助guyz。

Thanks in advance for all help guyz.

推荐答案

好guyz,事实证明,我找到了我的那个问题的解决方案。其实,我不知道为什么,但启动时发生,你需要点击一个名为同步工程与摇篮文件按钮,它会同步所有的项目一遍文件。就像我之前说的,我真的不明白为什么是必要的,但如果有人在将来这个问题,多数民众赞成的解决方案。谢谢你。

Well guyz, turns out that I found the solution for that problem of mine. Actually, I dont know why, but when that starts to happen you need to click on a button called "Sync Project with Gradle Files", and it will sync all your project files all over again. Like I said before, I really dont understand why that is needed, but in case someone have this problem in the future thats a solution. Thanks.

这篇关于Android的工作室 - 部署我的应用程序没有新的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆