Unable to Compile ant extensions

i am unable to compile, i tried to compile the same from ide.kodular.io it worked and i received my extension but the same code i am try to make in my computer am getting this error log

BuildServer:
[javac] Compiling 20 source files to C:\appinventor-sources\appinventor\buildserver\build\classes\BuildServer
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:12: error: package com.google.appinventor.components.common does not exist
[javac] import com.google.appinventor.components.common.ComponentDescriptorConstants;
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:262: error: cannot find symbol
[javac] loadJsonInfo(permissionsNeeded, ComponentDescriptorConstants.PERMISSIONS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:284: error: cannot find symbol
[javac] mergeConditionals(conditionals.get(ComponentDescriptorConstants.PERMISSIONS_TARGET), permissionsNeeded);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:380: error: cannot find symbol
[javac] loadJsonInfo(libsNeeded, ComponentDescriptorConstants.LIBRARIES_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:405: error: cannot find symbol
[javac] loadJsonInfo(nativeLibsNeeded, ComponentDescriptorConstants.NATIVE_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:430: error: cannot find symbol
[javac] loadJsonInfo(assetsNeeded, ComponentDescriptorConstants.ASSETS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:455: error: cannot find symbol
[javac] loadJsonInfo(activitiesNeeded, ComponentDescriptorConstants.ACTIVITIES_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:480: error: cannot find symbol
[javac] loadJsonInfo(broadcastReceiversNeeded, ComponentDescriptorConstants.BROADCAST_RECEIVERS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:492: error: cannot find symbol
[javac] mergeConditionals(conditionals.get(ComponentDescriptorConstants.BROADCAST_RECEIVERS_TARGET), broadcastReceiversNeeded);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:504: error: cannot find symbol
[javac] loadJsonInfo(componentBroadcastReceiver, ComponentDescriptorConstants.BROADCAST_RECEIVER_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:519: error: cannot find symbol
[javac] loadJsonInfo(minSdksNeeded, ComponentDescriptorConstants.ANDROIDMINSDK_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1762: error: cannot find symbol
[javac] boolean isV7a = lib.endsWith(ComponentDescriptorConstants.ARMEABI_V7A_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1763: error: cannot find symbol
[javac] boolean isV8a = lib.endsWith(ComponentDescriptorConstants.ARM64_V8A_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1764: error: cannot find symbol
[javac] boolean isx8664 = lib.endsWith(ComponentDescriptorConstants.X86_64_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1771: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.ARMEABI_V7A_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1775: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.ARM64_V8A_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1779: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.X86_64_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:2023: error: cannot find symbol
[javac] } else if (e.getMessage().contains(ComponentDescriptorConstants.ANDROIDMINSDK_TARGET)) {
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:2067: error: cannot find symbol
[javac] JSONObject conditionals = compJson.optJSONObject(ComponentDescriptorConstants.CONDITIONALS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 19 errors
[javac] 1 warning

BUILD FAILED
C:\appinventor-sources\appinventor\build.xml:40: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\buildserver\build.xml:55: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\build-common.xml:125: Compile failed; see the compiler error output for details.

Total time: 2 minutes 19 seconds
Picked up _JAVA_OPTIONS: -Xmx1024m

To start. you are including packages you do not have locally sourced.

Take a read of this as a start to locally building.

http://ai2.appinventor.mit.edu/reference/other/extensions.html

3 Likes

Actually @cian you’re incorrect. It’s because he/she isn’t including the end package. Just change it to this:

import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.common.*;

Make sure you have all three of those and your extension should compile again I think. By the way, if it’s saying cannot find symbol, you didn’t import that class.

1 Like

how to import classes?

use import and the class location in the jar file to import classes.

for example:
If you jar file structure is : com/test/sample/Function
then the import will be

import com.test.sample.Function;

i am unable to import the selected class why? i check that the class exists in that path even then i am getting error that package not found and symbol not found error

Do this Instead of Importing all the Runtime
import com.google.appinventor.components.runtime.*;

i am really upset about this i am trying to get this working but i dont know where i am getting wrong. @Abhijith_Dominic please message on whatsapp i want to talk with you on call please u have my no in Your DM.
Now i get this error:
BuildServer:
[mkdir] Created dir: C:\appinventor-sources\appinventor\buildserver\build\classes\BuildServer
[javac] Compiling 20 source files to C:\appinventor-sources\appinventor\buildserver\build\classes\BuildServer
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:12: error: package com.google.appinventor.components.common does not exist
[javac] import com.google.appinventor.components.common.ComponentDescriptorConstants;
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:262: error: cannot find symbol
[javac] loadJsonInfo(permissionsNeeded, ComponentDescriptorConstants.PERMISSIONS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:284: error: cannot find symbol
[javac] mergeConditionals(conditionals.get(ComponentDescriptorConstants.PERMISSIONS_TARGET), permissionsNeeded);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:380: error: cannot find symbol
[javac] loadJsonInfo(libsNeeded, ComponentDescriptorConstants.LIBRARIES_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:405: error: cannot find symbol
[javac] loadJsonInfo(nativeLibsNeeded, ComponentDescriptorConstants.NATIVE_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:430: error: cannot find symbol
[javac] loadJsonInfo(assetsNeeded, ComponentDescriptorConstants.ASSETS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:455: error: cannot find symbol
[javac] loadJsonInfo(activitiesNeeded, ComponentDescriptorConstants.ACTIVITIES_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:480: error: cannot find symbol
[javac] loadJsonInfo(broadcastReceiversNeeded, ComponentDescriptorConstants.BROADCAST_RECEIVERS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:492: error: cannot find symbol
[javac] mergeConditionals(conditionals.get(ComponentDescriptorConstants.BROADCAST_RECEIVERS_TARGET), broadcastReceiversNeeded);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:504: error: cannot find symbol
[javac] loadJsonInfo(componentBroadcastReceiver, ComponentDescriptorConstants.BROADCAST_RECEIVER_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:519: error: cannot find symbol
[javac] loadJsonInfo(minSdksNeeded, ComponentDescriptorConstants.ANDROIDMINSDK_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1762: error: cannot find symbol
[javac] boolean isV7a = lib.endsWith(ComponentDescriptorConstants.ARMEABI_V7A_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1763: error: cannot find symbol
[javac] boolean isV8a = lib.endsWith(ComponentDescriptorConstants.ARM64_V8A_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1764: error: cannot find symbol
[javac] boolean isx8664 = lib.endsWith(ComponentDescriptorConstants.X86_64_SUFFIX);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1771: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.ARMEABI_V7A_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1775: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.ARM64_V8A_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:1779: error: package ComponentDescriptorConstants does not exist
[javac] lib = lib.substring(0, lib.length() - ComponentDescriptorConstants.X86_64_SUFFIX.length());
[javac] ^
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:2023: error: cannot find symbol
[javac] } else if (e.getMessage().contains(ComponentDescriptorConstants.ANDROIDMINSDK_TARGET)) {
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] C:\appinventor-sources\appinventor\buildserver\src\com\google\appinventor\buildserver\Compiler.java:2067: error: cannot find symbol
[javac] JSONObject conditionals = compJson.optJSONObject(ComponentDescriptorConstants.CONDITIONALS_TARGET);
[javac] ^
[javac] symbol: variable ComponentDescriptorConstants
[javac] location: class Compiler
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 19 errors
[javac] 1 warning

BUILD FAILED
C:\appinventor-sources\appinventor\build.xml:40: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\buildserver\build.xml:55: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\build-common.xml:125: Compile failed; see the compiler error output for details.

Total time: 3 minutes 50 seconds
Picked up _JAVA_OPTIONS: -Xmx1024m

HtmlView.java (2.3 KB)