CodeName One error: cannot find symbol

冷暖自知 提交于 2019-12-22 08:23:53

问题


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

IDE: Eclipse Desktop OS: Windows

Executing 'Send IOS Debug Build' starts the server build and shows the following error: /var/folders/p7/d3z112yd0156kxkm2p21p8ym0000gn/T/build5327647990993852705xxx/stub/TestBuildDeployStub.java /var/folders/p7/d3z112yd0156kxkm2p21p8ym0000gn/T/build5327647990993852705xxx/stub/TestBuildDeployStub.java:14: error: cannot find symbol private TestBuildDeploy i; ^ symbol: class TestBuildDeploy location: class TestBuildDeployStub /var/folders/p7/d3z112yd0156kxkm2p21p8ym0000gn/T/build5327647990993852705xxx/stub/TestBuildDeployStub.java:23: error: cannot find symbol i = new TestBuildDeploy(); ^ symbol: class TestBuildDeploy location: class TestBuildDeployStub Note: /var/folders/p7/d3z112yd0156kxkm2p21p8ym0000gn/T/build5327647990993852705xxx/stub/TestBuildDeployStub.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 2 errors

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() {
    }

}

回答1:


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!



来源:https://stackoverflow.com/questions/37590391/codename-one-error-cannot-find-symbol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!