question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

junit framework not found

See original GitHub issue

Your Environment

  • Plugin version: 3.0.0 alpha 50
  • Platform: Android
  • Running in Simulator:
  • Cordova version (cordova -v): 8.1.2
  • Cordova platform version (cordova platform ls): Android 8.0.0
  • Plugin configuration options:
ionic cordova plugin add cordova-plugin-mauron85-background-geolocation@alpha --save 
--variable ANDROID_SUPPORT_LIBRARY_VERSION="23+" 
--variable GOOGLE_PLAY_SERVICES_VERSION="11.+" 
--variable ICON="@mipmap/ic_launcher" 
--variable SMALL_ICON="@mipmap/ic_launcher" 
--variable ACCOUNT_NAME="@string/app_name" 
--variable ACCOUNT_LABEL="@string/app_name"
--variable ACCOUNT_TYPE="$PACKAGE_NAME.account"
--variable CONTENT_AUTHORITY="$PACKAGE_NAME" 
--variable ALWAYS_USAGE_DESCRIPTION="description" 
--variable MOTION_USAGE_DESCRIPTION="description"

Context

Task :app:compileDebugJavaWithJavac FAILED
25 actionable tasks: 25 executed
BUILD FAILED in 40s
/../platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: /../platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/../platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:26: error: package junit.framework does not exist
import junit.framework.Assert;
                      ^
/../platforms/android/app/src/main/java/com/marianhello/bgloc/service/LocationServiceIntentBuilder.java:164: error: cannot find symbol
        Assert.assertNotNull("Context can not be null!", mContext);
        ^
  symbol:   variable Assert

Expected Behavior

After calling cordova android build, the build process should be successful

Actual Behavior

The error pops up when running cordova android build

Steps to Reproduce

  1. Install plugin with config above
  2. run cordova build android

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
diegohosilvercommented, May 10, 2020

@mowaiskalam

Hey guys, for anyone having this issue the fix is quite simple:

jUnit is used for testing purposes, I don’t know why the dependency is there. So what you have to do is open platforms\android\app\src\main\java\com\marianhello\bgloc\service\LocationServiceIntentBuilder.java and comment (or remove, it’s the same) the following lines:

26 - import junit.framework.Assert; 164 - Assert.assertNotNull("Context can not be null!", mContext);

After that everything should be working as expected.

3reactions
mauron85commented, Mar 25, 2019

If I remember correctly this has been fixed in common module, which was just updated to latest version. Try plugin version 3.0.0.0 (released just now).

Read more comments on GitHub >

github_iconTop Results From Across the Web

maven junit.framework does not exist - Stack Overflow
1. I suppose you imported the Maven project into IntelliJ properly, and do you see your declared junit dependency in External Libraries of ......
Read more >
package junit.framework does not exist – TeamCity Support
One thing I've run into - and I'm sure this is a newbie question - is testing. My build step is of type...
Read more >
error: package junit.framework does not exist - CodeRanch
when i compile my testcase with Ant as ant -f testbuild.xml compile.test getting this error as package junit.framework does not exist testbuild.xml its...
Read more >
the import org.junit cannot be resolved in Eclipse - Todd Lahman
1. Right click on the Java project and select Build Path > Configure Build Path. · 2. Click Add Library. · 3. Select...
Read more >
import junit.framework.Assert (Android Studio) 2020 - YouTube
Error project: import junit. framework.Assert (Android Studio) 2020Download Link ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found