本文介绍了CodeName一个错误:找不到符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用CodeNameOne创建了一个简单的示例应用程序,没有进行任何更改。
证书和配置文件可用并配置为项目属性。



IDE:Eclipse
桌面操作系统:Windows

这是java类:

  package com.canda.mario.myapp; 


导入com.codename1.ui.Display;
import com.codename1.ui.Form;
import com.codename1.ui.Dialog;
import com.codename1.ui.Label;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.util.Resources;
import com.codename1.io.Log;
import com.codename1.ui.Toolbar;
import java.io.IOException;

/ **
*此文件由< a href = https://www.codenameone.com/> Codename One< / a>生成目的
*使用Java构建本机移动应用程序。
* /
公共类TestBuildDeploy {

私人表单当前;
私人资源主题;

public void init(对象上下文){
theme = UIManager.initFirstTheme( / theme);

//默认情况下在所有窗体上启用工具栏
Toolbar.setGlobalToolbar(true);

//仅限于专业版,如果您有专业版订阅,请取消注释
// Log.bindCrashProtection(true);
}

public void start(){
if(current!= null){
current.show();
的回报;
}
Form hi = new Form( Hi World);
hi.addComponent(new Label( Hi World));
hi.show();
}

public void stop(){
current = Display.getInstance()。getCurrent();
if(Dialog的当前实例){
((Dialog)current).dispose();
current = Display.getInstance()。getCurrent();
}
}

public void destroy(){
}

}


解决方案

如果在创建代号一个应用程序后更改其程序包/类,则需要在以下两个位置都进行更改项目,并在 codenameone_settings.properties 中,这就是为什么我们建议不要更改它的原因。



我们不这样做这个过程很容易,因为您在创建包裹名称时已婚嫁。这用于在商店中唯一标识您的身份,并且一旦提交了应用程序就无法更改,因此您需要了解这不是您应该做的事情...在创建应用程序之前,请仔细考虑软件包名称! / p>

I have created a simple sample Application with CodeNameOne without any changes.Certificate and Provisioning file is available and configured as project properties.

IDE: EclipseDesktop OS: Windows

This is the java class:

package com.canda.mario.myapp;


import com.codename1.ui.Display;
import com.codename1.ui.Form;
import com.codename1.ui.Dialog;
import com.codename1.ui.Label;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.util.Resources;
import com.codename1.io.Log;
import com.codename1.ui.Toolbar;
import java.io.IOException;

/**
 * This file was generated by <a href="https://www.codenameone.com/">Codename One</a> for the purpose
 * of building native mobile applications using Java.
 */
public class TestBuildDeploy {

    private Form current;
    private Resources theme;

    public void init(Object context) {
        theme = UIManager.initFirstTheme("/theme");

        // Enable Toolbar on all Forms by default
        Toolbar.setGlobalToolbar(true);

        // Pro only feature, uncomment if you have a pro subscription
        // Log.bindCrashProtection(true);
    }

    public void start() {
        if(current != null){
            current.show();
            return;
        }
        Form hi = new Form("Hi World");
        hi.addComponent(new Label("Hi World"));
        hi.show();
    }

    public void stop() {
        current = Display.getInstance().getCurrent();
        if(current instanceof Dialog) {
            ((Dialog)current).dispose();
            current = Display.getInstance().getCurrent();
        }
    }

    public void destroy() {
    }

}
解决方案

If you change the package/class of a Codename One application after it's created you need to change it everywhere both in the project and in the codenameone_settings.properties that is why we recommend never changing it.

We don't make this process easy since you are married to life when creating a package name. This is used to uniquely identify you in the stores and can't be changed ever once an app is submitted so you need to understand that this isn't something you should do... Give package name deep consideration before creating the app!

这篇关于CodeName一个错误:找不到符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 17:54
查看更多