zhuowei / MCPELauncher

Source code for BlockLauncher, a launcher that patches Minecraft for Android
Apache License 2.0
675 stars 191 forks source link

java.lang.NoSuchMethodError: no method with name='getBroadcastAddresses' #237

Closed arpruss closed 8 years ago

arpruss commented 9 years ago

When I build and try to run, I get a crash when loading the original Minecraft library. The error message is: java.lang.NoSuchMethodError: no method with name='getBroadcastAddresses' signature='()[Ljava/lang/String;' in class Lcom/mojang/minecraftpe/MainActivity;

arpruss commented 9 years ago

And after I put in a dummy method of that name, I got the same error with getTotalMemory(). And then I put in a dummy getTotalMemory() method (I tried having it return 256mb, 24mb and 512mb) and I got a native code crash with backtrace:

I/DEBUG ( 166): #00 pc 0006ff3e /system/lib/libdvm.so (dvmGetVirtualizedMethod(ClassObject const, Method const)+1)

I/DEBUG ( 166): #01 pc 000503bd /system/lib/libdvm.so

I/DEBUG ( 166): #02 pc 0029c4a3 /mnt/asec/com.mojang.minecraftpe-1/lib/libminecraftpe.so (_JNIEnv::CallIntMethod(jobject, jmethodID, ...)+22)

I/DEBUG ( 166): #03 pc 0029da21 /mnt/asec/com.mojang.minecraftpe-1/lib/libminecraftpe.so (AppPlatform_android::initConsts(ENGINE*)+184)

I/DEBUG ( 166): #04 pc 0029e601 /mnt/asec/com.mojang.minecraftpe-1/lib/libminecraftpe.so (android_main+160)

I/DEBUG ( 166): #05 pc 002bf90f /mnt/asec/com.mojang.minecraftpe-1/lib/libminecraftpe.so

I/DEBUG ( 166): #06 pc 0000d278 /system/lib/libc.so (__thread_entry+72)

I/DEBUG ( 166): #07 pc 0000d410 /system/lib/libc.so (pthread_create+240)

This is all on a Galaxy S3 with 4.4.2. The Play store version of BlockLauncher works fine.

slice commented 9 years ago

Unfortunately, the source code in this repository is not compatible with modern versions of Minecraft: Pocket Edition.

The source code used for the Play Store version of BlockLauncher is private. This means that attempting to build and use BlockLauncher will only work for past certain versions of MC:PE.

BlockLauncher mimics Java methods from the actual game. When the game calls the Java methods, the mimic methods answer with the proper values. Some of these mimic methods are missing, and the application is crashing because it cannot find the proper method.

However, there is GenericLauncher, which mimics BlockLauncher in a bare-skeleton kind of way. It's "mimic methods" are updated for version 0.10.5 of Minecraft: Pocket Edition, but I am not aware if it will work in later versions. View the file here

arpruss commented 9 years ago

Thanks! Is it possible to use GenericLauncher with ModPE scripts?

slice commented 9 years ago

No.

GenericLauncher is bare bones, which means the only functionality it has is loading Minecraft into itself.

slice commented 9 years ago

@RandomAltThing BlockLauncher and GenericLauncher use the same system. Two projects for each app.

These commands (should do it). We assume the android, ant, and ndk-build executable is in your PATH.

android update project -t 1 -p GenericLauncher
android update project -t 1 -p GenericLauncher-app
cd GenericLauncher
ndk-build
ant clean debug
cd ..
cd GenericLauncher-app
ant clean debug

Finished APK in GenericLauncher-app/bin

zhuowei commented 8 years ago

This source code is no longer compatible with the latest MCPE (sorry :( ). Closing.