Didn't find class "com.rmsl.juce.JuceApp" on path

I created a new Android project on Projuce, opened in android studio, compiled and when tried to run on the phone, it did this:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.yourcompany.newproject, PID: 26286
    java.lang.RuntimeException: Unable to instantiate application com.rmsl.juce.JuceApp: java.lang.ClassNotFoundException: Didn't find class "com.rmsl.juce.JuceApp" on path: DexPathList[[zip file "/data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/base.apk"],nativeLibraryDirectories=[/data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/lib/arm64, /data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at android.app.LoadedApk.makeApplication(LoadedApk.java:980)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5823)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6617)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.rmsl.juce.JuceApp" on path: DexPathList[[zip file "/data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/base.apk"],nativeLibraryDirectories=[/data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/lib/arm64, /data/app/com.yourcompany.newproject-BVcXxHeLWryRVaycbeGYpg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.Instrumentation.newApplication(Instrumentation.java:1108)
        at android.app.LoadedApk.makeApplication(LoadedApk.java:974)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5823) 
        at android.app.ActivityThread.-wrap1(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6617) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)

I tried the default solutions for Android in this case:

buildTypes {
     debug {
         initWith debug
         debuggable    true
         jniDebuggable true
         signingConfig signingConfigs.juceSigning
         minifyEnabled false
         shrinkResources  false
     }

that is, adding

         minifyEnabled false
         shrinkResources  false

but I still get the same error

make sure

sourceSets {
    main.java.srcDirs +=
        ["../../../juce-6.0.8-linux/JUCE/modules/juce_core/native/javacore/init",
         "../../../juce-6.0.8-linux/JUCE/modules/juce_core/native/javacore/app",
         "../../../juce-6.0.8-linux/JUCE/modules/juce_gui_basics/native/javaopt/app"]

    main.res.srcDirs +=
        []
}

points to the correct location, otherwise the java files won’t be uploaded

Could happen mostly if you move the juce folder from place to place. In my opinion the juce folder should be inserted into the project