Apks compiled in android mode not working.

edited April 12 in Android Mode

So I´ve been tryng to compile and run a simple apk in different devices without any succes.

I´ve tryed the simplest of the codes .

void setup(){
  fullScreen();

}

void draw(){
    ellipse(mouseX,mouseY,10,10);         
}

I´ve already tryed in 3 different computers with 3 different devices without any success.

This de logcat :

Shutting down VM
04-12 15:42:47.788 7019 7019 E AndroidRuntime: FATAL EXCEPTION: main
04-12 15:42:47.788 7019 7019 E AndroidRuntime: Process: processing.test.mierda, PID: 7019
04-12 15:42:47.788 7019 7019 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.mierda/processing.test.mierda.MainActivity}: java.lang.ClassNotFoundException: Didn't find class ?

I´ve been searching in stackoverflow and it´s says that this is something that happens when it can´t find the class :

http://stackoverflow.com/questions/16102232/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo-classn

But my android manifest is the one that automatically generates processing :

    <?xml version="1.0" encoding="UTF-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="">
      <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="23"/>
      <application android:debuggable="true" android:icon="@drawable/icon" android:label="">
        <activity android:name=".MainActivity" android:theme="@android:style/Theme.NoTitleBar">
          <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
          </intent-filter>
        </activity>
      </application>
    </manifest>

Tryed using void settings, wont work.

Ive tryed : Sdk version Api 6.0(23),5.0,4.0 PC OS windows.

Android devices that I´ve tryed :

Moto X android version 5.1, Moto E (2 generation) with 4G LTE android version 5.1, Moto G android version 6,

Ideas? Suggestions?

Answers

  • operating system?

    processing version?

    android sdk version?

    device android version?

  • Ive tryed : Sdk version Api 6.0(23),5.0,4.0 PC OS windows.

    Android devices that I´ve tryed :

    Moto X Moto E (2 generation) with 4G LTE Moto G

  • edited April 18

    @Aurelian

    I was exploring stackoverflow and there are many reasons that could throw this sort of errors. For example:

    http://stackoverflow.com/questions/4688277/java-lang-runtimeexception-unable-to-instantiate-activity-componentinfo

    As frustrating as this is, the only way to be able to get some feedback is to provide as much details as possible. You have done a good job. However more is needed. Please forgive if this is asked again, but to try to capture meaningful information and for the record for this and future forum goers experiencing the same issues, this is what it is needed.


    Processing version

    Android mode Version

    Operating system

    Target APIs you have tried (Installed through the Android SDK manager and visible in the Processing IDE Android mode)

    Android SDK version. Did you install it yourself or using the automatic installation offered by the Processing IDE android mode?

    Have you run Android apps in Processing before? In any other SDK like Eclipse or Android Studio (AS)?

    Is this your first time? Did you enabled the developer mode in your device?

    did you check the following website as a reference: http://android.processing.org/install.html Did you try any other set of instructions? Which ones? Can you provide your link?

    Are you running your app in an actual device or through an emulator? (NOTE: It is strongly recommended to do it on an actual device)

    In case you found something meaningful in the forum or in other site, please provide links (If nothing found... leave blank).

    Have you tried anything else? For example, renaming/removing the manifest and letting Processing recreate the manifest for you again? (To access the manifest, press ctrl+k in your sketch and there should be a file called "manifest.xml")

    EDITED:****** Extra questions as suggested by akenaton

    Have you activated the debug mode on your phone + what is your phone OS ? ) + give us more error code (not only the first 2 lines)


    I have to say these problems sometimes are hard to solve mainly because they are very unlikely to be reproduced. Sometimes they could be solved if the issue is something obvious or in case that multiple users experience the same issue at the same time (Think along a catastrophic failed update) or when the Android experts pop up.

    Kf

  • @aurelian24===

    @kfrajer 'questions are what we have to know (i add: have you activated the debug mode on your phone + what is your phone OS ? ) + give us more error code (not only the first 2 lines)

    then:

    supposing that everything is ok: try to change the minSDK value to 16 or 17 (depends of the p5version you are using) try to export your app as android project look inside the folders, verify that your mainActivity is present and where

  • edited April 17

    Similar problems here:

    the sketch gets made and sent to the device but is not running.

    I tried to start over again with a fresh "Processing" folder:

    • I removed processings sketch folder and let it create a new one in ~/Documents
    • Then closed Processing and manually installed android mode by downloading AndroidMode-260.zip placing it inside ~/Documents/Processing/modes and unzipping
    • restarted Processing
    • opened a simple sketch
    • I removed the Manifest.xml and let it create a new one
    • switched to android mode
    • let it install its Android SDK automatically
    • it downloads the 800+ Mb but fails to install: "Bad news... The Android SDK could not be loaded. The Android Mode will be disabled."

    • I noticed a new sdk folder inside the "Android mode" folder and chose that manually

    • Android mode is now running

    • checked the Android menu under Devices and can see my device
    • ran the sketch
    • the android device reacts, screen turns black, then it reads "sketch name stopped."

    Attached:

    • Additional Information on my environment
    • my Manifest.xml
    • Processing's error message at the end of the attempt to run the sketch
    • some additional error messages I saw during the compile process

    Processing version:

    3.3

    Android mode Version:

    0260 / Version 4.0-beta7

    Device Android Version

    6.0.1

    Operating system:

    macOS 10.12.4

    Target APIs you have tried (Installed through the Android SDK manager and visible in the Processing IDE Android mode)

    The standard set of tools is installed:

    • Android SDK tools 25.2.5
    • Android SDK Platform-tools 25.0.4
    • Android SDK Build-tools 26rc1
    • Android 7.1.1 (API 25) :
      • SDK Platform Rev 3
    • Extras:
      • Android Support Repository 47
      • Google Repository 46

    Nothing else

    Android SDK version. Did you install it yourself or using the automatic installation offered by the Processing IDE android mode?

    automatic

    Have you run Android apps in Processing before? In any other SDK like Eclipse or Android Studio (AS)?

    I installed AS. Should I uninstall?

    Is this your first time? Did you enabled the developer mode in your device?

    I never had a java app successfully transfered to the device, if that's what you mean. Debug mode is working, the sketch ends up on the device ( I can click the icon on the device).

    did you check the following website as a reference: http://android.processing.org/install.html Did you try any other set of instructions? Which ones? Can you provide your link?

    yes. no.

    Are you running your app in an actual device or through an emulator? (NOTE: It is strongly recommended to do it on an actual device)

    device

    In case you found something meaningful in the forum or in other site, please provide links (If nothing found... leave blank).

    Have you tried anything else? For example, renaming/removing the manifest and letting Processing recreate the manifest for you again? (To access the manifest, press ctrl+k in your sketch and there should be a file called "manifest.xml")

    I did this. No improvement.


    my Manifest.xml:

    <?xml version="1.0" encoding="UTF-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package=""> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25"/> <application android:icon="@drawable/icon" android:label=""> <activity android:name=".MainActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest>


    Here is the tail of processing's console contents:

    debug: FATAL EXCEPTION: main Process: processing.test.androidsimpleexample, PID: 28141 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{processing.test.androidsimpleexample/processing.test.androidsimpleexample.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "processing.test.androidsimpleexample.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.androidsimpleexample-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.androidsimpleexample-2/lib/arm, /vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3132) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.ClassNotFoundException: Didn't find class "processing.test.androidsimpleexample.MainActivity" on path: DexPathList[[zip file "/data/app/processing.test.androidsimpleexample-2/base.apk"],nativeLibraryDirectories=[/data/app/processing.test.androidsimpleexample-2/lib/arm, /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:1096) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) ... 9 more Suppressed: java.io.IOException: Failed to open dex files from /data/app/processing.test.androidsimpleexample-2/base.apk at dalvik.system.DexFile.openDexFileNative(Native Method) at dalvik.system.DexFile.openDexFile(DexFile.java:295) at dalvik.system.DexFile.<init>(DexFile.java:80) at dalvik.system.DexFile.<init>(DexFile.java:59) at dalvik.system.DexPathList.loadDexFile(DexPathList.java:279) at dalvik.system.DexPathList.makePathElements(DexPathList.java:248) at dalvik.system.DexPathList.<init>(DexPathList.java:120) at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48) at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:86) at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:47) at android.app.LoadedApk.getClassLoader(LoadedApk.java:438) at android.app.LoadedApk.makeApplication(LoadedApk.java:663) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6395) at android.app.ActivityThread.access$1800(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887) ... 6 more Suppressed: java.lang.ClassNotFoundException: processing.test.androidsimpleexample.MainActivity at java.lang.Class.classForName(Native Method)asdf` at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 12 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available


    Some intermediary output in Processings console:

    console

  • Answer ✓

    Hey ! I solve it out downloading the android SDK separated to processing and connecting in when the windows to "search for android SDK in pc" is prompt.

  • Which Android SDK did you download? SDK 7.1.1 (API 25)? Which Android version is on your device? Would be great to find a solution!

Sign In or Register to comment.