我从稳定的频道更新到Android Studio 2.1.我一做到这一点,我就得到了我的登录类的ClassNotFoundException,它在清单中声明了很长时间.在更新之前,我的应用程序编译正常.
com.myapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myapp, PID: 29605
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.myapp/com.myapp.Login}: java.lang.ClassNotFoundException: Didn't find class "com.myapp.Login" on path: DexPathList[[zip file "/data/app/com.myapp-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294)
at android.app.ActivityThread.access$1000(ActivityThread.java:210)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1704)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.myapp.Login" on path: DexPathList[[zip file "/data/app/com.myapp-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.app.Instrumentation.newActivity(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3013)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3294)
at android.app.ActivityThread.access$1000(ActivityThread.java:210)
at …Run Code Online (Sandbox Code Playgroud) 我刚刚将Android SDK,ADT和Proguard升级到最新版本.
我的项目编译构建并在调试模式下运行良好,但是一旦我尝试导出它的签名版本APK,我就会从Eclipse控制台上的导出向导收到错误而没有任何错误日志消息!*

如果我尝试通过Window->Show View->Error Log所有查看错误日志,我看到更多相同:

我不知道该怎么办,因为Eclipse和Proguard都不会暗示问题是什么.
我的项目在最近的升级之前一直很好.没有构建警告.没有棉绒警告!
我正在使用Android的标准配置文件${sdk.dir}\tools\proguard\proguard-android.txt:
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-verbose
-dontoptimize
-dontpreverify
-keepattributes *Annotation*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgent
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.support.v4.app.Fragment
-keep …Run Code Online (Sandbox Code Playgroud) 我有一个华硕Eee Tab(Transformer Prime TF201 Android v4.1.1).我正在阅读关于Geofencing的API并将下面的示例应用程序下载到我的设备=> http://developer.android.com/training/location/geofencing.html.但是当我打开它时它会终止.
我在AndroidManifest.xml文件中设置了目标sdk = 16
logcat的
06-04 19:39:34.176: E/AndroidRuntime(2596): FATAL EXCEPTION: main
06-04 19:39:34.176: E/AndroidRuntime(2596): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android.geofence/com.example.android.geofence.MainActivity}: java.lang.ClassNotFoundException: com.example.android.geofence.MainActivity
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.app.ActivityThread.access$600(ActivityThread.java:130)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.os.Handler.dispatchMessage(Handler.java:99)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.os.Looper.loop(Looper.java:137)
06-04 19:39:34.176: E/AndroidRuntime(2596): at android.app.ActivityThread.main(ActivityThread.java:4745)
06-04 19:39:34.176: E/AndroidRuntime(2596): at java.lang.reflect.Method.invokeNative(Native Method)
06-04 19:39:34.176: E/AndroidRuntime(2596): at java.lang.reflect.Method.invoke(Method.java:511)
06-04 19:39:34.176: E/AndroidRuntime(2596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) …Run Code Online (Sandbox Code Playgroud) android geolocation classnotfoundexception geofencing android-geofence
我最近刚收到设备"Desire HD(ace)"的错误报告,我无法为我的生活重新创建.我查看了Here1和Here2,但它似乎不能帮助我解决我的问题,或者我只是不理解这一点,以了解这是否是我的问题的解决方案.
我的LogCat:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{joseph.lubonty.librarysmite11/joseph.lubonty.librarysmite11.Splash}: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash in loader dalvik.system.PathClassLoader[/mnt/asec/joseph.lubonty.librarysmite11-2/pkg.apk]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1738)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
at android.app.ActivityThread.access$1500(ActivityThread.java:132)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4196)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: joseph.lubonty.librarysmite11.Splash in loader dalvik.system.PathClassLoader[/mnt/asec/joseph.lubonty.librarysmite11-2/pkg.apk]
at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
... 11 more
Run Code Online (Sandbox Code Playgroud)
我的清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="joseph.lubonty.librarysmite11"
android:installLocation="preferExternal"
android:versionCode="19"
android:versionName="2.7" >
<compatible-screens>
<!-- all normal size screens -->
<screen …Run Code Online (Sandbox Code Playgroud) 我创建了一个 Android主库项目,在其中创建了一个自定义视图类:
package com.my.android.library.layout;
public class CustomView extends View {
...
Run Code Online (Sandbox Code Playgroud)
我还为我定义了styleableCustomView:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="CustomView">
<attr name="title_text" format="string" />
</declare-styleable>
</resources>
Run Code Online (Sandbox Code Playgroud)
由于我不想将我的源代码分享给使用我的库项目的其他人,所以我创建了一个分布式库项目,其中我将上述主库项目的 jar 添加到分布式库项目的libs/文件夹中,并从主库项目到分布式库项目。
接下来,我制作了一个使用分布式库项目的android 应用项目。在 app 项目的主布局文件中,我定义了以下内容:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.my.android.library.layout.CustomView
custom:title_text = "THIS IS TITLE"
/>
<RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序时,出现以下异常:
E/AndroidRuntime(30993): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.my.android.app/com.my.android.app.MainActivity}: android.view.InflateException: Binary XML file line #7: …Run Code Online (Sandbox Code Playgroud) android android-custom-view android-layout android-library android-custom-attributes
您好,
每次在 Eclipse 中创建 Android 应用程序时,我都会收到 ClassNotFoundException 异常。这是在使用 eclipse 几个月后直到今天早上之前从未发生过的事情。值得一提的是,我今天早上通过 SDK 管理器安装了 google play 服务
Logcat:
11-03 12:39:29.080: E/AndroidRuntime(27547): FATAL EXCEPTION: main
11-03 12:39:29.080: E/AndroidRuntime(27547): Process: com.example.app, PID: 27547
11-03 12:39:29.080: E/AndroidRuntime(27547): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.app.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.app-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.app-1, /vendor/lib, /system/lib]]
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.app.ActivityThread.access$900(ActivityThread.java:161)
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.os.Handler.dispatchMessage(Handler.java:102)
11-03 12:39:29.080: E/AndroidRuntime(27547): at android.os.Looper.loop(Looper.java:157) …Run Code Online (Sandbox Code Playgroud) eclipse android android-manifest classnotfoundexception android-activity
迁移 androidx 后,当我单击按钮时,它会向我显示\n为什么会发生这种情况?
\n\n当我点击按钮打开日历时我想要做什么
\n\n这是我点击按钮时的错误
\n\n java.lang.ClassNotFoundException: Didn\'t find class "com.example.blogapp.whateverString" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.example.blogapp-BjDX\nRun Code Online (Sandbox Code Playgroud)\n\n这是我的 Manifest.xml,其中有任何字符串的形式
\n\n<?xml version="1.0" encoding="utf-8"?>\n<manifest xmlns:android="http://schemas.android.com/apk/res/android"\n xmlns:tools="http://schemas.android.com/tools"\n package="com.example.together">\n <!--\n The ACCESS_COARSE/FINE_LOCATION permissions are not required to use\n Google Maps Android API v2, but you must specify either coarse or fine\n location permissions for the \'MyLocation\' functionality.\n -->\n <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- \xeb\xa7\xb5 \xec\x9d\xb4\xec\x9a\xa9\xed\x95\x98\xea\xb8\xb0 \xec\x9c\x84\xed\x95\xa8 -->\n <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />\n <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- \xeb\x8b\xa4\xec\x9d\x8c \xec\xa7\x80\xeb\x8f\x84 -->\n <uses-permission android:name="android.permission.INTERNET" …Run Code Online (Sandbox Code Playgroud) 我有这个包格式:
com
example
name
oldAppName
Run Code Online (Sandbox Code Playgroud)
现在,我通过Shift + F6重构并重命名为:
com
myCompanyName
name
newAppName
Run Code Online (Sandbox Code Playgroud)
但是,现在当我运行我的应用程序时,我遇到了这个崩溃:
java.lang.ClassNotFoundException: Didn't find class "com.example.name.oldAppName.Application" on path: DexPathList[[zip file "/data/app/com.myCompanyName.name.newAppName1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
Run Code Online (Sandbox Code Playgroud)
我有我的Application.java下newAppName,并且它在Manifest中正确定义
我尝试和做过的是:
applicationId在build.gradle中更改实际上,这是我的应用程序清单标记:
<application
android:name=".Application"
...
>
Run Code Online (Sandbox Code Playgroud)
甚至更改.Application为完整的包名称(com.blah.blah.Application) 不工作.
我错过了什么吗?有缺失的一步吗?
这是完整的日志:
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.ClassNotFoundException: com.example.name.oldAppName.Application
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4345)
at android.app.ActivityThread.access$1500(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5045)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at …Run Code Online (Sandbox Code Playgroud) refactoring android packages classnotfoundexception android-studio
android ×8
eclipse ×2
adt ×1
androidx ×1
geofencing ×1
geolocation ×1
java ×1
manifest ×1
packages ×1
proguard ×1
refactoring ×1