cannot find symbol DaggerAppComponent, Cause: java.lang.ExceptionInInitializerError - android

I was trying to build my Dagger2 based Android project in Android studio Arctic fox 2020.3.1 with Mac M1 and I got the error,
error: cannot find symbol
import xxxx.com.xxxx.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
which also was showing
Cause: java.lang.ExceptionInInitializerError
The same project was working in another machine(not mac).
Also I am unable to see the compiler error toggle button in android studio build output.
Please help me to resolve this.
complete build output,
Executing tasks: [:app:assembleDebug] in project /projects/Android/prototype
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsDebug UP-TO-DATE
Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:injectCrashlyticsMappingFileIdDebug UP-TO-DATE
Task :app:processDebugGoogleServices UP-TO-DATE
Task :app:mergeDebugResources UP-TO-DATE
Task :app:dataBindingGenBaseClassesDebug UP-TO-DATE
Task :app:dataBindingTriggerDebug UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:checkDebugAarMetadata UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugMainManifest UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:processDebugManifestForPackage UP-TO-DATE
Task :app:processDebugResources UP-TO-DATE
Task :app:compileDebugJavaWithJavac FAILED
The following annotation processors are not incremental: dagger-android-processor-2.16.jar (com.google.dagger:dagger-android-processor:2.16), dagger-compiler-2.16.jar (com.google.dagger:dagger-compiler:2.16).
Make sure all annotation processors are incremental to improve your build speed.
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/provision/PairingActivity.java:22: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/provision/ProvisionActivity.java:41: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/splash/SplashActivity.java:20: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/appliance/AddApplianceActivity.java:15: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/appliance/event/AddEventActivity.java:8: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/welcome/WelcomeActivity.java:10: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:mergeDebugShaders UP-TO-DATE
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets UP-TO-DATE
Task :app:compressDebugAssets UP-TO-DATE
Task :app:processDebugJavaRes NO-SOURCE
Task :app:checkDebugDuplicateClasses UP-TO-DATE
Task :app:desugarDebugFileDependencies UP-TO-DATE
Task :app:mergeExtDexDebug UP-TO-DATE
Task :app:mergeLibDexDebug UP-TO-DATE
Task :app:mergeDebugJniLibFolders UP-TO-DATE
Task :app:mergeDebugNativeLibs NO-SOURCE
Task :app:stripDebugDebugSymbols NO-SOURCE
Task :app:validateSigningDebug UP-TO-DATE
Task :app:writeDebugAppMetadata UP-TO-DATE
Task :app:writeDebugSigningConfigVersions UP-TO-DATE
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.ExceptionInInitializerError
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
29 actionable tasks: 1 executed, 28 up-to-date

I'd love to comment but I have not enough reputation, anyway, are you using room in your project? I had the same issue also only on my Mac M1, it was caused by the room version, I updated it to 2.4.0-alpha03 and it builds fine since then. if not, you may want to check the version of the libraries you are using, but yeah only on Mac M1, hope it helps.

Related

AAPT: error: attribute android:extractNativeLibs not found

I tried to build APK from unity exported project
and then I encountered error
I need to build it using SDK version 22 (android 5.1)
the main problem is
Execution failed for task ':launcher:processDebugResources'
the detail as below
Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :launcher:preDebugBuild UP-TO-DATE
Task :unityLibrary:preDebugBuild UP-TO-DATE
Task :unityLibrary:compileDebugAidl NO-SOURCE
Task :unityLibrary:packageDebugRenderscript NO-SOURCE
Task :launcher:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
Task :launcher:compileDebugAidl NO-SOURCE
Task :unityLibrary:compileDebugRenderscript NO-SOURCE
Task :launcher:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:generateDebugResValues UP-TO-DATE
Task :launcher:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:generateDebugResources UP-TO-DATE
Task :launcher:checkDebugAarMetadata UP-TO-DATE
Task :launcher:generateDebugResValues UP-TO-DATE
Task :unityLibrary:packageDebugResources UP-TO-DATE
Task :launcher:generateDebugResources UP-TO-DATE
Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
Task :launcher:mergeDebugResources UP-TO-DATE
Task :unityLibrary:processDebugManifest UP-TO-DATE
Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
Task :launcher:extractDeepLinksDebug UP-TO-DATE
Task :launcher:processDebugMainManifest UP-TO-DATE
Task :launcher:processDebugManifest UP-TO-DATE
Task :launcher:processDebugManifestForPackage UP-TO-DATE
Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
Task :launcher:mergeDebugShaders UP-TO-DATE
Task :launcher:compileDebugShaders NO-SOURCE
Task :launcher:generateDebugAssets UP-TO-DATE
Task :unityLibrary:generateDebugRFile UP-TO-DATE
Task :launcher:processDebugJavaRes NO-SOURCE
Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:compileDebugJavaWithJavac UP-TO-DATE
Task :unityLibrary:bundleLibCompileToJarDebug UP-TO-DATE
Task :unityLibrary:mergeDebugShaders UP-TO-DATE
Task :unityLibrary:compileDebugShaders NO-SOURCE
Task :unityLibrary:generateDebugAssets UP-TO-DATE
Task :unityLibrary:packageDebugAssets UP-TO-DATE
Task :unityLibrary:processDebugJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResDebug NO-SOURCE
Task :unityLibrary:bundleLibRuntimeToJarDebug UP-TO-DATE
Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
Task :unityLibrary:mergeDebugNativeLibs UP-TO-DATE
Task :unityLibrary:stripDebugDebugSymbols UP-TO-DATE
WARNING: NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please use android.ndkVersion or android.ndkPath in build.gradle to specify the NDK to use. https://developer.android.com/r/studio-ui/ndk-dir
NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please use android.ndkVersion or android.ndkPath in build.gradle to specify the NDK to use. https://developer.android.com/r/studio-ui/ndk-dir
Task :unityLibrary:copyDebugJniLibsProjectOnly UP-TO-DATE
Task :launcher:processDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml","position":{"startLine":36}}],"original":"/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml:37: AAPT: error: attribute android:extractNativeLibs not found.\n ","tool":"AAPT"}
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':launcher:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml:37: AAPT: error: attribute android:extractNativeLibs not found.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 1s
31 actionable tasks: 1 executed, 30 up-to-date
Any help or info are appreciated
thanks you

Copy AAR after assembleDebug

Can someone please tell my why this does nothing? I've messed with it for two days. The text is never printed, copyAAR is never run. Should be so simple but obviously I'm missing something. This is a project with a main "app" and one module called "MY_Library". This code is in the build.gradle file for My_Library. THANKS!
task copyAAR(dependsOn:'assembleDebug') << {
println "++++++ AAR COPIED ++++++: "
}
Also tried:
afterEvaluate {
copyAAR.dependsOn ':MY_Library:assembleDebug'
}
task copyAAR() << {
println "++++++ AAR COPIED ++++++: "
}
Executing tasks: [:MY_Library:assembleDebug]
Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_bxaa81mwx93hvs7njvdit9vtz$_run_closure1.doCall(C:\zzz\zzz\zzz\zzz\MY_Library\build.gradle:19)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
:MY_Library:preBuild UP-TO-DATE
:MY_Library:preDebugBuild UP-TO-DATE
:MY_Library:compileDebugAidl UP-TO-DATE
:MY_Library:compileDebugRenderscript UP-TO-DATE
:MY_Library:checkDebugManifest UP-TO-DATE
:MY_Library:generateDebugBuildConfig UP-TO-DATE
:MY_Library:generateDebugResValues UP-TO-DATE
:MY_Library:generateDebugResources UP-TO-DATE
:MY_Library:packageDebugResources UP-TO-DATE
:MY_Library:platformAttrExtractor UP-TO-DATE
:MY_Library:processDebugManifest UP-TO-DATE
:MY_Library:generateDebugRFile UP-TO-DATE
:MY_Library:prepareLintJar UP-TO-DATE
:MY_Library:generateDebugSources UP-TO-DATE
:MY_Library:javaPreCompileDebug UP-TO-DATE
:MY_Library:compileDebugJavaWithJavac UP-TO-DATE
:MY_Library:extractDebugAnnotations UP-TO-DATE
:MY_Library:mergeDebugConsumerProguardFiles UP-TO-DATE
:MY_Library:mergeDebugShaders UP-TO-DATE
:MY_Library:compileDebugShaders UP-TO-DATE
:MY_Library:generateDebugAssets UP-TO-DATE
:MY_Library:packageDebugAssets UP-TO-DATE
:MY_Library:packageDebugRenderscript NO-SOURCE
:MY_Library:processDebugJavaRes NO-SOURCE
:MY_Library:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:MY_Library:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:MY_Library:compileDebugNdk NO-SOURCE
:MY_Library:mergeDebugJniLibFolders UP-TO-DATE
:MY_Library:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:MY_Library:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
:MY_Library:bundleDebug UP-TO-DATE
:MY_Library:compileDebugSources UP-TO-DATE
:MY_Library:assembleDebug UP-TO-DATE
BUILD SUCCESSFUL in 0s
23 actionable tasks: 23 up-to-date
Well, the only way I got it to work was:
afterEvaluate {
assembleDebug.finalizedBy(copyAAR)
}
Why did the other way not work?!?!?

Ionic framework 'compileDebugJavaWithJavac' error while building apk

I am working with Ionic framework and trying to build APK, using ionic build android command and getting Execution failed for task ':compileDebugJavaWithJavac'
Here is the complete Log:
D:\Ionic\IonicUserBase>ionic build android
WARN: ionic.project has been renamed to ionic.config.json, please rename it.
ANDROID_HOME=C:\Android\Sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_91
Subproject Path: CordovaLib
Incremental java compilation is an incubating feature.
:preBuild
UP-TO-DATE
:preDebugBuild
UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild
UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest
UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard
UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl
UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig
UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest
UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\Ionic\IonicUserBase\platforms\android\src\org\apache\cordova\filetransfer\FileTransfer.java:692: error: cannot find symbol
if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
D:\Ionic\IonicUserBase\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:122: error: cannot find symbol
|| Config.isUrlWhiteListed(url)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
Note: Some input files use or override a deprecated API.
:compileDebugJavaWithJavac FAILED
BUILD FAILED
Total time: 5.734 secs
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
D:\Ionic\IonicUserBase\platforms\android\src\org\apache\cordova\filetransfer\FileTransfer.java:692: error: cannot find symbol
if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
D:\Ionic\IonicUserBase\platforms\android\src\org\apache\cordova\inappbrowser\InAppBrowser.java:122: error: cannot find symbol
|| Config.isUrlWhiteListed(url)) {
^
symbol: method isUrlWhiteListed(String)
location: class Config
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
This is my very first project with Ionic framework, and I am actually not getting the exact way to resolve this issue...
It looks like that error is being generated by the cordova-file-transfer plugin. It's possible you have an old version as you are getting a deprecated API notice.
Try removing the plugin and re-adding it with:
ionic plugin remove cordova-plugin-file-transfer
Then:
ionic plugin add cordova-plugin-file-transfer
And then try rebuilding the app.

parse error in gradle - ExecException

My android app needs to do some work with SQL Server using JDBC,
So I've added sqlljdbc42.jar file in module,
But I got error in Build - Gradle, Below is my Gradle Console :
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Alpha1Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72400Alpha1Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42400Alpha1Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2400Alpha1Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:preDexDebug
AGPBI: {"kind":"SIMPLE","text":"PARSE ERROR:","position":{},"original":"PARSE ERROR:"}
AGPBI: {"kind":"SIMPLE","text":"unsupported class file version 52.0","position":{},"original":"unsupported class file version 52.0"}
AGPBI: {"kind":"SIMPLE","text":"...while parsing com/microsoft/sqlserver/jdbc/ActivityCorrelator.class","position":{},"original":"...while parsing com/microsoft/sqlserver/jdbc/ActivityCorrelator.class"}
AGPBI: {"kind":"SIMPLE","text":"1 error; aborting","position":{},"original":"1 error; aborting"}
BUILD FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
and in Gradle Build windows I got This :
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with non-zero exit value 1
Connections String is working fine and My MainActivity.java file contains :
public class MainActivity extends ActionBarActivity {
TextView tv;
Connection DbConn;
Statement stmt;
ResultSet reset;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = (TextView) findViewById(R.id.textView);
try {
Log.e("Inside the Try Block", "Pre - Done");
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
DbConn = DriverManager.getConnection("{connection string}");
Log.e("Connection","open");
stmt = DbConn.createStatement();
reset = stmt.executeQuery(" select * from Members");
tv.setText("User Name : "+reset.getString(1)+", Name : "+reset.getString(2));
DbConn.close();
} catch(Exception e) {
Log.e("Error connection", "" + e.getMessage());
e.printStackTrace();
}
}
}
The error is caused due to mismatching bytecode versions of the compiler and the classes in the included .jar archive
see got unsupported class file version 52 0 after including a module to a project for details
EDIT: using sqljdbc41.jar instead of sqljdbc42.jar should solve the issue

Error:(12) No resource identifier found for attribute 'scalteType' in package 'android'

Getting error messages when running an app on debug mode during the Gradle Build in Android Studio.
This is the error message:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
/Users/ramonsingh/AndroidStudioProjects/Stopwatch/app/src/main/res/layout/main.xml
Error:(12) No resource identifier found for attribute 'scalteType' in package 'android'
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/.../Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 10.298 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
I've just started building this app, the only file I've changed is the main.xml.
Also, not sure if this is related, but when I go into the Design tab on the main.xml, i get this error:
Rendering Problems The following classes could not be instantiated:
- android.support.v7.internal.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE Exception Details java.lang.NoClassDefFoundError: Could not initialize class android.support.v7.internal.widget.ActionBarOverlayLayout   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)   at android.view.LayoutInflater.inflate(LayoutInflater.java:482)   at android.view.LayoutInflater.inflate(LayoutInflater.java:414)   at com.android.layoutlib.bridge.bars.BridgeActionBar.(BridgeActionBar.java:84)   at com.android.layoutlib.bridge.bars.AppCompatActionBar.(AppCompatActionBar.java:56) Copy stack to clipboard
Appreciate your help.
All the information you need is right here, before your eyes.
No resource identifier found for attribute 'scalteType' in package 'android'
There is no attribute called "scalteType" in ImageView. Find it in the layout file 'main.xml' and change to "scaleType".

Categories

Resources