Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error deploying the application in Android Studio #5

Open
pelupotter opened this issue May 14, 2020 · 4 comments
Open

Error deploying the application in Android Studio #5

pelupotter opened this issue May 14, 2020 · 4 comments

Comments

@pelupotter
Copy link

pelupotter commented May 14, 2020

When I go to test the application, deploying in Android Studio, I get an error in the Constants.java class due to an imported library that is not used.


import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; <-- this import is not used too
import android.support.annotation.NonNull; <-- Here got the error

import java.util.Arrays;
import java.util.List;

public class Constants {

    private Context context;

Sorry for my english.

Bye!

@sazima
Copy link

sazima commented Jun 11, 2020

@pelupotter
Have you solved it. I had the same problem

 Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest
> Task :app:processDebugResources

> Task :app:compileDebugJavaWithJavac FAILED
/home/user/projects/MyApp/platforms/android/app/src/main/java/cordova/plugin/PowerOptimization/Constants.java:9: error: cannot find symbol
import androidx.annotation.NonNull;
                          ^
  symbol:   class NonNull
  location: package androidx.annotation
...

@sazima
Copy link

sazima commented Jun 11, 2020

Maybe it can help you.
open platforms/android/app/build.gradle and add implementation "androidx.annotation:annotation:1.1.0" to dependencies

dependencies {
  
   // ..............
    // SUB-PROJECT DEPENDENCIES END
    implementation "androidx.annotation:annotation:1.1.0"

}

kkrekk pushed a commit to kkrekk/cordova-plugin-power-optimization that referenced this issue Sep 24, 2022
@gabrielrincon
Copy link

this is the solution

256fbed#r996488657

snt1017 added a commit that referenced this issue Nov 20, 2022
Fixed Issue #5 Error deploying the application in Android Studio
@Dstefannn
Copy link

Hi, how can i install this version?
The latest version is 0.0.4 which still has this NonNull thingy on https://www.npmjs.com/package/cordova-plugin-power-optimization/v/0.0.3?activeTab=versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants