error: cannot find symbol in PytorchDemoApp - java

I am not Android developer, I am just trying to deploy a demo app of object detection in android and everything seems to go well while "make project" in Android Studio, but when I am trying to export the ".APK" file I get the following error
... AbstractCameraXActivity.java:22: error: cannot find symbol
import androidx.camera.core.ImageAnalysisConfig;
^
symbol: class ImageAnalysisConfig
location: package androidx.camera.core
Tha same happens with other package which is PreviewConfig.
Both errors are marked in the AbstractCameraXActivity.java file. And due to I am not Android developer, I don't know how to debug and solve this issue.
I know this could be better to ask in the issue's repo, but I think this is an error related with import package so maybe another Android/Java developer can help me.
Somebody knows how to solve it?
Thanks in advance.

Related

JavaFX cannot find symbol symbol: class PixelBuffer on compile

I installed the project demo from here https://github.com/caprica/vlcj-javafx-demo and followed this tutorial exactly to install and run it in the latest version of IntelliJ on Mac: https://www.youtube.com/watch?v=yzmokfajN0o
But unlike in the video I get this error when launching the program:
Error:(39, 26) java: cannot find symbol
symbol: class PixelBuffer
location: package javafx.scene.image
The only difference seems to be I'm using Mac and in the video a pc is used. It clearly works as is since we see it running in the video linked above so the code cannot have any actual errors. There are no errors showing anywhere in the project for me either. If I search for 'PixelBuffer' using navigate class in IntelliJ it also finds it no problem:
I've spoken with the developer at length about it and he was as clueless as I am to why it would not work so if anyone can shed some light on this it would be great.

Minecraft Forge 1.16.5 changes since 1.16.4 - compiling error

I am trying to learn Minecraft modding, and while following a tutorial for version 1.16.4, I found that their code did not work, and I presume this is a change to the API, since I am using 1.16.5.
I have looked at both official and unofficial API docs, but these did not provide me any insight. Could anyone point me to a better API reference, or better yet, to a VSCode extension that autocompletes for the most recent Forge API.
Here is the compile error when I ran ./gradlew.bat build with my minimal reproducible example (sorry about the code highlighting, I don't know how to fix it):
C:\Users\eric\Desktop\Programming\Java\Minecraft Mod 1\src\main\java\com\ericl5445\testmod1\core\init\ItemInit.java:1: error: package net.minecraftforge.item does not exist
import net.minecraftforge.item.Item;
^
C:\Users\eric\Desktop\Programming\Java\Minecraft Mod 1\src\main\java\com\ericl5445\testmod1\core\init\ItemInit.java:2: error: package net.minecraftforge.item does not exist
import net.minecraftforge.item.ItemGroup;
^
Here is my full code:
TestMod1.java
ItemInit.java
Any help would really be appreciated!
I do not have an api reference, however I have found that the ItemGroup class is not under net.minecraftforge.item. It is under the package net.minecraft.item.
Your IDE, usually Intellij Idea or Eclipse, should be able to tell you where these classes are located via a search functionality. In Eclipse, you can press Control/Command + Shift + T to bring up a search box with a list of all the classes in your workspace.
The Package You Need To import is net.minecraft.item.Item and net.minecraft.itemGroup,
Not net.minecraftforge.item.Item and net.minecraftforge.itemGroup

which package contains EnableKinesisStreamingDestinationRequest

Please help me find which package or package version I need in order to call EnableKinesisStreamingDestinationRequest to enable Kinesis streaming on a dynamoDB table.
The Amazon docs point to this package:com.amazonaws.services.dynamodbv2.model
But I can't get past the error in eclipse saying:
com.amazonaws.services.dynamodbv2.model.EnableKinesisStreamingDestinationRequest cannot be resolved
Eclipse help took me to the class EnableKinesisStreamingDestinationRequest and it shows a different package at the top:
package software.amazon.awssdk.services.dynamodb.model;
But import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationRequest cannot be resolved either.
Thanks in advance.

How do I update all libraries, after Migrating to AndroidX? [duplicate]

This question already has an answer here:
Migrate resource files to Androidx
(1 answer)
Closed 3 years ago.
I've have recently migrated my app to AndroidX, blindly without knowing the ins and outs. As a result every time I run the project, it gives me a load of errors.
I have updated all my Gradle Dependencies and targetSDK to the most recent version code. I have also added the following to gradle.properties:
android.useAndroidX=true
android.enableJetifier=true
But this has still made no difference.
Some of the following are examples of errors I am getting:
error: package android.support.annotation does not exist
error: package android.support.v7.widget does not exist
error: package RecyclerView does not exist
error: cannot find symbol class FragmentActivity
error: cannot find symbol class CardView
error: cannot find symbol class FragmentPagerAdapter
error: cannot find symbol class DialogFragment
I would just like to know I can get rid of these errors, as it is stopping me from running the project on my mobile device?
Here you can find the full class mapping.
In your case you have to change the imports:
error: package android.support.annotation does not exist
error: package android.support.v7.widget does not exist
Packages:
package androidx.annotation.*;
package androidx.appcompat.widget.*;
Classes:
android.support.v4.app.FragmentActivity androidx.fragment.app.FragmentActivity
android.support.v7.widget.CardView androidx.cardview.widget.CardView
android.support.v4.app.FragmentPagerAdapter androidx.fragment.app.FragmentPagerAdapter
android.support.v7.app.AppCompatDialogFragment androidx.appcompat.app.AppCompatDialogFragment
android.support.v7.widget.RecyclerView androidx.recyclerview.widget.RecyclerView
You seem to have everything set up correctly in your gradle file. The problem is that there are missing packages that have not yet been converted/migrated to AndroidX. Here's a little trick you can do:
Go to your app.gradle file and right-click anywhere.
Select Refactor on the menu that pops up.
In the sub-menu, select Migrate to AndroidX
Sit back and let Android studio migrate all your files.
To learn more, check this out.
I hope this helps. Merry coding!
In the Android Studio menu go to Refactor and select Migrate to AndroidX.
Rest the android studio will automatically do.
Other than this if you still find the error then you will have to manual perform certain task.
In the layout find all the old one and replace it like
android.support.v7.widget.CardView
with
androidx.cardview.widget.CardView
you will find the mapping related information here https://developer.android.com/jetpack/androidx/migrate/class-mappings
just find the old text by using Ctr+F and copy the replacement text
In the app build
implementation 'com.android.support:cardview-v7:28.0.0'
with
implementation 'androidx.cardview:cardview:1.0.0'
you will find mapping related information here https://developer.android.com/jetpack/androidx/migrate/artifact-mappings

When building mopub sdk, cannot find symbol: class org.fest.assertions.api.ANDROID

I am building Mopub SDK as a module using Intellij Idea.
I have copied test-assert-core-2.0M10.jar to libs folder under Mopub. However, when building it, the line import org.fest.assertions.api.ANDROID; shows red color at the word "ANDROID". Compilation error message says:
Error:(20, 31) java: cannot find symbol
symbol: class ANDROID
location: package org.fest.assertions.api
Have searched, but found nothing about this particular error.
Anybody using Mopub under Intellij Idea can offer some hint? Thanks!
I've found the solution. I deleted all files under /mopub-sdk/src/test, and it builds successfully.

Categories

Resources