Why error from appybuilder

[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/contact2niraj/Magnifier/Magnifier.java:18: error: package android.widget.Magnifier does not exist
    [javac] import android.widget.Magnifier.Builder;

why error like this i saw this class here -
https://developer.android.com/reference/android/widget/Magnifier.Builder

I think that class maynot be suitable for extensions that’s why

but when i type just android.widget.Magnifier it works

hmmmmmm then the ones who are pros in java can help

1 Like

add this and then try

import android.widget;
1 Like

There is a possibility that appybuilder code editor uses an old android library, which doesn’t have the classes that was added in new API versions (API 28), and therefore, the JAVA compiler can’t find the class you imported.

2 Likes

I tried and got this

AndroidRuntime:
[javac] Compiling 332 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/anshmishra2166/Newproj/Newproj.java:5: error: cannot find symbol
[javac] import android.widget.Magnifier;
[javac]                      ^
[javac]   symbol:   class Magnifier
[javac]   location: package android.widget
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/anshmishra2166/Newproj/Newproj.java:6: error: package android.widget.Magnifier does not exist
[javac] import android.widget.Magnifier.Builder;
[javac]                                ^
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
[javac] 1 warning

so if i use app inventor sources to create it may work?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.