caused by: java.lang.ClassNotFoundException - eclipse

It is very frustrating that when running said app on a device or an emulator the "Unfortunately, app name has stopped" error came up. I believe that (by looking at the LogCat) I have pinpointed the problem to the error "java.lang.ClassNotFoundException". How I can fix this?
This is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.benchaful.newboard"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.benchaful.newBoard.activity"
android:label="#string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" />
</application>
<uses-sdk android:targetSdkVersion="16" android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
This is my main layout file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.benchaful.newboard"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout android:layout_width="fill_parent"
android:id="#+id/home_layout"
android:orientation="vertical"
android:layout_height="wrap_content"
android:background="#000000"
>
There is some buttons here
<WebView
android:id="#+id/accesskey"
android:layout_width="fill_parent"
android:layout_height="100px"
/>
</LinearLayout>
</ScrollView>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.benchaful.newboard"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:gravity="bottom"
android:layout_alignParentBottom="true"
android:layout_alignBottom="#+id/home_layout"
>
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/libs/com.google.ads"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="a151a7cc8c54403"
ads:adSize="BANNER"
/>
</LinearLayout>
</RelativeLayout>
And this is my LogCat
06-06 20:03:05.355: E/AndroidRuntime(8409): FATAL EXCEPTION: main
06-06 20:03:05.355: E/AndroidRuntime(8409): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.benchaful.newboard/com.benchaful.newBoard.activity}: java.lang.ClassNotFoundException: com.benchaful.newBoard.activity
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2045)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2146)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread.access$700(ActivityThread.java:140)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.os.Handler.dispatchMessage(Handler.java:99)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.os.Looper.loop(Looper.java:137)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread.main(ActivityThread.java:4944)
06-06 20:03:05.355: E/AndroidRuntime(8409): at java.lang.reflect.Method.invokeNative(Native Method)
06-06 20:03:05.355: E/AndroidRuntime(8409): at java.lang.reflect.Method.invoke(Method.java:511)
06-06 20:03:05.355: E/AndroidRuntime(8409): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
06-06 20:03:05.355: E/AndroidRuntime(8409): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
06-06 20:03:05.355: E/AndroidRuntime(8409): at dalvik.system.NativeStart.main(Native Method)
06-06 20:03:05.355: E/AndroidRuntime(8409): Caused by: java.lang.ClassNotFoundException: com.benchaful.newBoard.activity
06-06 20:03:05.355: E/AndroidRuntime(8409): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
06-06 20:03:05.355: E/AndroidRuntime(8409): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
06-06 20:03:05.355: E/AndroidRuntime(8409): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
06-06 20:03:05.355: E/AndroidRuntime(8409): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2036)

Check the name of your class in manifest file.
change com.benchaful.newBoard.activity to com.benchaful.newBoard.activity.ComponentInfo
activity android:name="com.benchaful.newBoard.activity.ComponentInfo"...

Related

Flutter [local_auth] Doesn't work on Android <28

I'm trying to work with local_auth, updating from 0.4.0 to 0.6.2
I followed the instructions, changing the FlutterActivity to FlutterFragmentActivity in my MainActivity.java
( according with this guide https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects and with this thread https://github.com/flutter/flutter/issues/57678)
In this way
import io.flutter.embedding.android.FlutterFragmentActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.embedding.engine.FlutterEngine;
public class MainActivity extends FlutterFragmentActivity {
#Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
I also changed my style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">#drawable/launch_background</item>
</style>
</resources>
and my AndroidManifest.xml
<application
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:fullBackupContent="false"
android:label="XXX">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:name="com.apptreesoftware.barcodescan.BarcodeScannerActivity"/>
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="${applicationId}.flutter_downloader.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/provider_paths"/>
</provider>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
It works on Android 28 and higher, but not on older versions.
When I run on android 27 I got this error
I/zygote (10611): Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/widget/TintableCompoundDrawablesView; I/zygote (10611): (Throwable with no stack trace) I/zygote (10611): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.widget.TintableCompoundDrawablesView" on path: DexPathList[[zip file "/data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/base.apk"],nativeLibraryDirectories=[/data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/lib/x86, /data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/base.apk!/lib/x86, /system/lib, /vendor/lib]] I/zygote (10611): (Throwable with no stack trace) I/zygote (10611): E/MethodChannel#plugins.flutter.io/local_auth(10611): Failed to handle method call E/MethodChannel#plugins.flutter.io/local_auth(10611): android.view.InflateException: Binary XML file line #26: Binary XML file line #45: Error inflating class androidx.appcompat.widget.DialogTitle E/MethodChannel#plugins.flutter.io/local_auth(10611): Caused by: android.view.InflateException: Binary XML file line #45: Error inflating class androidx.appcompat.widget.DialogTitle E/MethodChannel#plugins.flutter.io/local_auth(10611): Caused by: java.lang.ClassNotFoundException: androidx.appcompat.widget.DialogTitle E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.VMClassLoader.findLoadedClass(Native Method) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.ClassLoader.loadClass(ClassLoader.java:363) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.createView(LayoutInflater.java:606) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflate(LayoutInflater.java:863) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:995) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflate(LayoutInflater.java:859) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:515) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:423) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:374) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AlertController.installContent(AlertController.java:232) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.app.Dialog.dispatchOnCreate(Dialog.java:403) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.app.Dialog.show(Dialog.java:302) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.DialogFragment.onStart(DialogFragment.java:486) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.Fragment.performStart(Fragment.java:2632) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:915) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.fragment.app.FragmentManagerImpl.executePendingTransactions(FragmentManagerImpl.java:183) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.biometric.BiometricPrompt.authenticateInternal(BiometricPrompt.java:749) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.biometric.BiometricPrompt.authenticate(BiometricPrompt.java:658) E/MethodChannel#plugins.flutter.io/local_auth(10611): at io.flutter.plugins.localauth.AuthenticationHelper.authenticate(AuthenticationHelper.java:103) E/MethodChannel#plugins.flutter.io/local_auth(10611): at io.flutter.plugins.localauth.LocalAuthPlugin.onMethodCall(LocalAuthPlugin.java:120) E/MethodChannel#plugins.flutter.io/local_auth(10611): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226) E/MethodChannel#plugins.flutter.io/local_auth(10611): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/MethodChannel#plugins.flutter.io/local_auth(10611): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.os.MessageQueue.next(MessageQueue.java:325) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.os.Looper.loop(Looper.java:142) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.app.ActivityThread.main(ActivityThread.java:6494) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) E/MethodChannel#plugins.flutter.io/local_auth(10611): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/widget/TintableCompoundDrawablesView; E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1383) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:492) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:423) E/MethodChannel#plugins.flutter.io/local_auth(10611): at android.view.LayoutInflater.inflate(LayoutInflater.java:374) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.policy.DecorView.onResourcesLoaded(DecorView.java:1933) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2586) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2659) E/MethodChannel#plugins.flutter.io/local_auth(10611): at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2067) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:717) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:659) E/MethodChannel#plugins.flutter.io/local_auth(10611): at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:552) E/MethodChannel#plugins.flutter.io/local_auth(10611): ... 30 more E/MethodChannel#plugins.flutter.io/local_auth(10611): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.core.widget.TintableCompoundDrawablesView" on path: DexPathList[[zip file "/data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/base.apk"],nativeLibraryDirectories=[/data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/lib/x86, /data/app/it.xxx.flutter.xxx-bwyNjP_RiFiWr_SW3gO7MQ==/base.apk!/lib/x86, /system/lib, /vendor/lib]] E/MethodChannel#plugins.flutter.io/local_auth(10611): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/MethodChannel#plugins.flutter.io/local_auth(10611): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/MethodChannel#plugins.flutter.io/local_auth(10611): ... 44 more
That's my conf
[✓] Flutter: is fully installed. (Channel stable, v1.17.3, on Mac OS X 10.15.5 19F101, locale en-IT)
[✓] Android toolchain - develop for Android devices: is fully installed. (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS: is fully installed. (Xcode 11.5)
[✓] Android Studio: is fully installed. (version 3.6)
[✓] VS Code: is fully installed. (version 1.45.1)
[✓] Connected device: is fully installed. (1 available)
Any suggestions will be appreciated
For me helps:
Activity
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
Manifest
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="your label"
android:icon="#mipmap/ic_launcher">
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="#drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- The Agora SDK requires Bluetooth permissions in case users are using Bluetooth devices.-->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
I'm probably late, but today I had the same problem and for me was useful to follow this solution
https://github.com/hnvn/flutter_image_cropper/issues/78
Remove these parts
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
if (requested.group == "androidx") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "${targetSdk}.+"
}
from Android/build.gradle
I solve my issue...
i removed
if (
details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex')
) {
details.useVersion "27.1.1"
}
if (
details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx')
) {
details.useVersion "1.0.1"
}
if (requested.group == "androidx" && !requested.name.startsWith("multidex")) {
details.useVersion "${targetSdk}.+"
}
from android/build.gradle
and it work

Couldn't find class in spite of the fact that Dex is enabled

I am trying to migrate an app from Eclipse to the android studio I have just the files and the last person who was writing it in eclipse didn't export it for importing project. I have started a new project and manually imported the files and the lib files and tried to solve the errors till the program is now running with no Gradle errors. now I am in this situation that the dex in Gradle is enabled but when I run the program it is confused and tells me it doesn't recognize some classes.
this is my manifest file
<permission
android:name="com.company.MyProject.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<supports-screens android:smallScreens="true" />
<supports-screens android:normalScreens="true" />
<supports-screens android:largeScreens="true" />
<supports-screens android:xlargeScreens="true" />
<supports-screens android:anyDensity="true" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.company.MyProject.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.CLEAR_APP_CACHE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.company.MyProject.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.company.MyProject.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name="com.company.MyProject.TruckApplication"
android:allowBackup="true"
android:icon="#drawable/MyProject_logo"
android:label="#string/app_name"
android:largeHeap="true"
android:sharedUserId="android.uid.system"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.company.MyProject.Authenticate_user_Activity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.company.MyProject.Login_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.SubmitWaiver_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepStopChoice"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<!--<activity-->
<!--android:name="com.company.MyProject.Surveyold_Activity"-->
<!--android:configChanges="keyboardHidden|orientation|screenSize"-->
<!--android:screenOrientation="portrait" >-->
<!--</activity>-->
<activity
android:name="com.company.MyProject.GetStops_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Load_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.AddComment_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
android:name="com.company.MyProject.StopDetail_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.CaptureImage_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Survey_Activity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.GetDirection_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.Map_FragmentActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.TabBar"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.ShowStopList_Activity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.company.MyProject.PrepActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:screenOrientation="landscape" >
</activity>
<activity
android:name="com.company.MyProject.TransprentActivity"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustPan" >
</activity>
<receiver
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.company.MyProject" />
</intent-filter>
</receiver>
<service android:name="com.MyProject.Service.SyncService" >
</service>
<receiver android:name="com.MyProject.BrodcastReciver.NetworkStateReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<receiver android:name="com.company.MyProject.RepeatingAlarmService" />
<receiver android:name="com.company.MyProject.RepeatingAlaramCommunication" />
<receiver android:name="com.company.MyProject.ReaptingAlramNewStops" />
<service android:name="com.MyProject.Service.LogoutService" >
</service>
<service android:name="com.MyProject.Service.CallNewStop_Service" >
</service>
<service android:name="com.MyProject.Service.CheckingGooglePlayVersionService" >
</service>
<receiver
android:name="com.MyProject.BrodcastReciver.DateTimeChangeReceiver"
android:enabled="true"
android:exported="false" >
<intent_filter>
<action android:name="android.intent.action.DATE_CHANGED" />
</intent_filter>
</receiver>
<!-- Start the Service if applicable on boot -->
<receiver android:name="com.MyProject.BrodcastReciver.PhoneReStartReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name="com.company.MyProject.TruckLocationUpdateService"
android:enabled="true" />
<service
android:name="com.company.MyProject.TruckCommubicationcountService"
android:enabled="true" />
<service android:name="com.company.MyProject.GCMIntentService" />
<service android:name="com.company.MyProject.HandleNotification" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyB6Ae82d_eLZ1nMYIW7EaaQ3-2-Xn7duHs" />
<!-- android:value="AIzaSyAkZzWl6FSP89yWf7VeX6ooYvd6SuRnV4E" /> -->
</application>
<!--<uses-permission-->
<!--android:name="android.permission.ACCESS_MOCK_LOCATION"-->
<!--android:required="false" />-->
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-permission
android:name="android.permission.FLASHLIGHT"
android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
android:protectionLevel="normal"
android:required="false" />
this is my gradle File
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.company.MyProject"
minSdkVersion 14
targetSdkVersion 25
versionCode 70
versionName "7.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// compile 'com.android.support:appcompat-v4:25'
testCompile 'junit:junit:4.12'
// compile fileTree(include: '*.jar', dir: 'libs')
compile 'com.google.android.gms:play-services:10.2.1'
// compile "com.google.android.gms:play-services-gcm:10.2.1"
// compile 'org.apache.httpcomponents:httpmime:4.5.3'
// compile files('libs/gson-2.2.4.jar')
// compile files('libs/httpmime-4.2.2.jar')
// compile files('libs/joda-time-2.1.jar')
// compile files('libs/universal-image-loader-1.9.4.jar')
compile files('libs/android-support-v4.jar')
}
And this is my error log
AndroidRuntime: FATAL EXCEPTION: main
Process: com.company.MyProject, PID: 27974
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.company.MyProject/com.company.MyProject.Authenticate_user_Activity}: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.company.MyProject.Authenticate_user_Activity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6119) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 
Suppressed: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/MyProject/Interface/Authenticate_Interface;
at java.lang.VMClassLoader.findLoadedClass(Native Method)
at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:742)
at java.lang.ClassLoader.loadClass(ClassLoader.java:362)
... 12 more
04-04 19:37:17.028 27974-27974/com.company.MyProject E/AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.MyProject.Interface.Authenticate_Interface" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.company.MyProject-2/base.apk", zip file "/data/app/com.company.MyProject-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.company.MyProject-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.company.MyProject-2/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
... 15 more
could you guys please help me to solve my problem.

NavigationDrawer unable to instatiate application java.lang.classnotfoundexception

I`m developing an app. And at this part I only have an activity for my Navigation Drawer.
Im trying to run but I get the same Exception everytime.. Ive searched for some time, tried a lot of things but nothing worked.
Here`s my logcat:
02-23 17:45:09.379: E/AndroidRuntime(3364): FATAL EXCEPTION: main
02-23 17:45:09.379: E/AndroidRuntime(3364): Process: com.example.testedrawer, PID: 3364
02-23 17:45:09.379: E/AndroidRuntime(3364): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.testedrawer/com.example.testedrawer.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.testedrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.testedrawer-2/base.apk"],nativeLibraryDirectories= [/vendor/lib, /system/lib]]
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.app.ActivityThread.access$800(ActivityThread.java:144)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.os.Handler.dispatchMessage(Handler.java:102)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.os.Looper.loop(Looper.java:135)
02-23 17:45:09.379: E/AndroidRuntime(3364): at android.app.ActivityThread.main(ActivityThread.java:5221)
02-23 17:45:09.379: E/AndroidRuntime(3364): at java.lang.reflect.Method.invoke(Native Method)
02-23 17:45:09.379: E/AndroidRuntime(3364): at java.lang.reflect.Method.invoke(Method.java:372)
02-23 17:45:09.379: E/AndroidRuntime(3364): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
02-23 17:45:09.379: E/AndroidRuntime(3364): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
02-23 17:45:09.379: E/AndroidRuntime(3364): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.testedrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.testedrawer-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-23 17:45:09.379: E/AndroidRuntime(3364): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-23 17:45:09.379: E/AndroidRuntime(3364): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
My Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testedrawer"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Please help me..
Ive already fixed it. Ive tried so many things that didn't work on Eclipse. Than I tried to do it on Android Studio.. And it worked! Thanks for your help, though!

App Crashes on launching specific activity

My app crashes every time I try to launch the RegisterActivity. I have swapped out several other activities and the button launches them. Just not RegisterActivity. It is in the Manifest and there are no errors. I cannot figure out the problem. Any help will be greatly appreciated. Code follows:
// Link to Register Screen
btnLinkToRegister.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(v.getContext(), RegisterActivity.class);
startActivityForResult(intent, 0);
The Activity that crashes the app:
package com.dip.allnavyinfo;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class RegisterActivity extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set View to register.xml
setContentView(R.layout.register);
TextView loginScreen = (TextView) findViewById(R.id.link_to_login);
// Listening to Login Screen link
loginScreen.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// Closing registration screen
// Switching to Login Screen/closing register screen
finish();
}
});
}
}
LogCat:
08-25 06:44:15.677: E/AndroidRuntime(1200): FATAL EXCEPTION: main
08-25 06:44:15.677: E/AndroidRuntime(1200): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.dip.allnavyinfo; is package not installed?
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.os.Handler.dispatchMessage(Handler.java:99)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.os.Looper.loop(Looper.java:137)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.ActivityThread.main(ActivityThread.java:5103)
08-25 06:44:15.677: E/AndroidRuntime(1200): at java.lang.reflect.Method.invokeNative(Native Method)
08-25 06:44:15.677: E/AndroidRuntime(1200): at java.lang.reflect.Method.invoke(Method.java:525)
08-25 06:44:15.677: E/AndroidRuntime(1200): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
08-25 06:44:15.677: E/AndroidRuntime(1200): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-25 06:44:15.677: E/AndroidRuntime(1200): at dalvik.system.NativeStart.main(Native Method)
08-25 06:44:15.677: E/AndroidRuntime(1200): Caused by: java.lang.IllegalStateException: Unable to get package info for com.dip.allnavyinfo; is package not installed?
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:369)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
08-25 06:44:15.677: E/AndroidRuntime(1200): at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
08-25 06:44:15.677: E/AndroidRuntime(1200): ... 11 more
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dip.allnavyinfo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".SplashScreenActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Main Activity -->
<activity
android:name=".MainActivity"
android:label="#string/main" >
</activity>
<activity
android:name=".Bibs"
android:label="#string/title_activity_bibs" >
</activity>
<activity
android:name=".LoginActivity"
android:label="#string/lgnlbl">
</activity>
<activity
android:name=".RegisterActivity"
android:label="#string/reglbl">
</activity>
</application>
<uses-permission
android:name="android.permission.INTERNET" />
</manifest>
1- make sure that you have defined the activity RegisterActivity in your Manifest
2- change this :
Intent intent = new Intent(v.getContext(), RegisterActivity.class);
startActivityForResult(intent, 0);
into
Intent intent = new Intent(yourCurrentActivity.this, RegisterActivity.class);
startActivity(intent);
I had the same problem, I fixed it by sorting out my async tasks. I was making two calls in the same thread, once I separated them into two threads the problem was solved.

HoloEverywhere AutoCompleteTextView java.lang.ClassCastException

I am trying to get the HoloEverywhere class AutoCompleteTextView to work with my app. The main reason for this is I want the Holo theme to work on pre 3.0 devices (specifically API levels 8-10) Here is my main activity code:
package com.example.testautocomp;
import org.holoeverywhere.widget.AutoCompleteTextView;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class MainActivity extends Activity {
private AutoCompleteTextView m_edit;
private static final String[] items = { "lorem", "ipsum", "dolor", "sit",
"amet", "consectetuer", "adipiscing", "elit", "morbi", "vel",
"augue", "purus", "sitter", "sitting", "sither", "sithar" };
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
m_edit = (AutoCompleteTextView)findViewById(R.id.edit2);
m_edit.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line, items));
}
}
also my activity_main.xml code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<AutoCompleteTextView
android:id="#+id/edit2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:hint="Testing" />
</LinearLayout>
When I run my app, it goes into the debugger for eclipse and after pressing resume (or F8) to continue the thread, my app crashes/force closes and I get the following error in my LogCat:
04-19 17:52:56.342: W/dalvikvm(675): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-19 17:52:56.422: E/AndroidRuntime(675): FATAL EXCEPTION: main
04-19 17:52:56.422: E/AndroidRuntime(675): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testautocomp/com.example.testautocomp.MainActivity}: java.lang.ClassCastException: android.widget.AutoCompleteTextView cannot be cast to org.holoeverywhere.widget.AutoCompleteTextView
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.os.Handler.dispatchMessage(Handler.java:99)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.os.Looper.loop(Looper.java:137)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-19 17:52:56.422: E/AndroidRuntime(675): at java.lang.reflect.Method.invokeNative(Native Method)
04-19 17:52:56.422: E/AndroidRuntime(675): at java.lang.reflect.Method.invoke(Method.java:511)
04-19 17:52:56.422: E/AndroidRuntime(675): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-19 17:52:56.422: E/AndroidRuntime(675): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-19 17:52:56.422: E/AndroidRuntime(675): at dalvik.system.NativeStart.main(Native Method)
04-19 17:52:56.422: E/AndroidRuntime(675): Caused by: java.lang.ClassCastException: android.widget.AutoCompleteTextView cannot be cast to org.holoeverywhere.widget.AutoCompleteTextView
04-19 17:52:56.422: E/AndroidRuntime(675): at com.example.testautocomp.MainActivity.onCreate(MainActivity.java:22)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.Activity.performCreate(Activity.java:4465)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-19 17:52:56.422: E/AndroidRuntime(675): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-19 17:52:56.422: E/AndroidRuntime(675): ... 11 more
How do i fix this CastClassException?
No, your action above incorrect. You should change activity base class on org.holoeverywhere.app.Activity.
Very similar to this question
Fixed it by changing my main_activity.xml to:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<org.holoeverywhere.widget.AutoCompleteTextView
android:id="#+id/edit2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:completionThreshold="1"
android:hint="Testing" />
</LinearLayout>
the main part being org.holoeverywhere.widget.AutoCompleteTextView