Hello, I am upgrading a widget-enabled app to targetSDK 31. When I install the widget, it does not load and I get an error. java.lang.RuntimeException: Unable to start receiver com.tempusumbra.solarwidget.solarw4x2$solarw4x2_BR: android.app.ForegroundServiceStartNotAllowedException...
Hello, I am upgrading a widget-enabled app to targetSDK 31. When I install the widget, it does not load and I get an error. java.lang.RuntimeException: Unable to start receiver com.tempusumbra.solarwidget.solarw4x2$solarw4x2_BR: android.app.ForegroundServiceStartNotAllowedException...
Starting step: Creating XML file.
javadoc: warning - The old Doclet and Taglet APIs in the packages
com.sun.javadoc, com.sun.tools.doclets and their implementations
are planned to be removed in a future JDK release. These
components have been superseded by the new APIs in jdk.javadoc.doclet.
Users are strongly recommended to migrate to the new APIs.
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:3: error: package android.graphics does not exist
import android.graphics.Bitmap;
did you added android.jar from platforms\android-30 as a dependency?
Note that i do use Eclipse usuall and need to add this jar to every project in Eclipse as dependency.
Also note that i never worked with an Api >30 so i can not answer if this is of help.
Erel, definately using SLC V1.11 for building Android Libs. Have just downloaded and extracted it again to make sure I am using the right one. This is the complete error - it builds the Jar successfully but fails to create the XML. Is it maybe because I am using Java 11?
B4X:
Starting step: Compiling Java code.
javac 11.0.1
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
javadoc: warning - The old Doclet and Taglet APIs in the packages
com.sun.javadoc, com.sun.tools.doclets and their implementations
are planned to be removed in a future JDK release. These
components have been superseded by the new APIs in jdk.javadoc.doclet.
Users are strongly recommended to migrate to the new APIs.
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:3: error: package android.graphics does not exist
import android.graphics.Bitmap;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:4: error: package android.graphics.Bitmap does not exist
import android.graphics.Bitmap.Config;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:5: error: package android.graphics does not exist
import android.graphics.BitmapFactory;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:6: error: package android.os does not exist
import android.os.Build;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:7: error: package android.util does not exist
import android.util.Log;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:144: error: cannot find symbol
public Bitmap decode() {
^
symbol: class Bitmap
location: class JP2Decoder
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\gemalto\jp2\JP2Decoder.java:209: error: cannot find symbol
private Bitmap nativeToBitmap(int[] data) {
^
symbol: class Bitmap
location: class JP2Decoder
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\ImageUtil.java:18: error: package android.content does not exist
import android.content.Context;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\ImageUtil.java:19: error: package android.graphics does not exist
import android.graphics.Bitmap;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\ImageUtil.java:20: error: package android.graphics does not exist
import android.graphics.BitmapFactory;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\ImageUtil.java:31: error: cannot find symbol
public static Bitmap decodeImage(Context context, String mimeType, InputStream inputStream) throws IOException {
^
symbol: class Context
location: class ImageUtil
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\ImageUtil.java:31: error: cannot find symbol
public static Bitmap decodeImage(Context context, String mimeType, InputStream inputStream) throws IOException {
^
symbol: class Bitmap
location: class ImageUtil
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:18: error: package android.app does not exist
import android.app.Activity;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:19: error: package android.app does not exist
import android.app.PendingIntent;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:20: error: package android.content does not exist
import android.content.Intent;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:21: error: package android.content does not exist
import android.content.SharedPreferences;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:22: error: package android.graphics does not exist
import android.graphics.Bitmap;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:23: error: package android.nfc does not exist
import android.nfc.NfcAdapter;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:24: error: package android.nfc does not exist
import android.nfc.Tag;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:25: error: package android.nfc.tech does not exist
import android.nfc.tech.IsoDep;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:26: error: package android.os does not exist
import android.os.AsyncTask;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:27: error: package android.os does not exist
import android.os.Bundle;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:28: error: package android.preference does not exist
import android.preference.PreferenceManager;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:29: error: package android.text does not exist
import android.text.Editable;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:30: error: package android.text does not exist
import android.text.TextWatcher;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:31: error: package android.util does not exist
import android.util.Base64;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:32: error: package android.util does not exist
import android.util.Log;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:33: error: package android.view does not exist
import android.view.View;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:34: error: package android.view does not exist
import android.view.WindowManager;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:35: error: package android.widget does not exist
import android.widget.EditText;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:37: error: package android.os does not exist
import android.os.Build;
^
C:\Users\johans\Documents\Basic4Android\b4aProjects\PassportReader\src\com\tananaev\passportreader\MainActivity.java:97: error: cannot access ViewGroup
public class MainActivity extends AppCompatActivity {
^
class file for android.view.ViewGroup not found
java.lang.NullPointerException
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.runPhase(TypeEnter.java:934)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:282)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.doCompleteEnvs(TypeEnter.java:877)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:251)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:266)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:266)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:266)
at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:198)
at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1326)
at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:583)
at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:560)
at jdk.javadoc/com.sun.tools.javadoc.main.JavadocEnter.main(JavadocEnter.java:81)
at jdk.javadoc/com.sun.tools.javadoc.main.JavadocTool.getRootDocImpl(JavadocTool.java:222)
at jdk.javadoc/com.sun.tools.javadoc.main.Start.parseAndExecute(Start.java:426)
at jdk.javadoc/com.sun.tools.javadoc.main.Start.begin(Start.java:238)
at jdk.javadoc/com.sun.tools.javadoc.main.Start.begin(Start.java:224)
at jdk.javadoc/com.sun.tools.javadoc.Main.execute(Main.java:174)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:419)
at jdk.javadoc/jdk.javadoc.internal.tool.Start.begin(Start.java:344)
at jdk.javadoc/jdk.javadoc.internal.tool.Main.execute(Main.java:63)
at jdk.javadoc/jdk.javadoc.internal.tool.Main.main(Main.java:52)
javadoc: error - fatal exception
Error.