Java.lang.VerifyError

I am getting error

An exception of type: java.lang.VerifyError occurred
Message: {java.lang.VerifyError: Verifier rejected class com.tenthdoor.mylogs.DbRepository due to bad method void com.tenthdoor.mylogs.DbRepository.$makeUpdateSqls$b__0(sugar.collections.KeyValue) (declaration of ‘com.tenthdoor.mylogs.DbRepository’ appears in /data/app/com.tenthdoor.mylogs-1/base.apk)}
at AppDb.()
MainActivity.onCreate()

when I run my android app.

Following is the code it is failing on

	private func makeUpdateSqls() -> Boolean {
	ModifiedItems.ForEach({x in {
		self.handleModifiedItem(x.Key, x.Value)
	}})

	return UpdateSql.Count > 0
}

public func handleModifiedItem(_ item: T, _ itemStatus: ObjectStatus) {
	switch itemStatus {
		case ObjectStatus.Added: addInsertSql(item)
		case ObjectStatus.Modified: addUpdateSql(item)
		case ObjectStatus.Removed: addDeleteSql(item)
		default: __throw Exception("Invalid ObjectStatus")
	}
}

if I remove self.handleModifiedItem(x.Key, x.Value) then I don’t get this error.

Thanks, logged as bugs://72184

what type is ModifiedItems and how is ObjectStatus defined? (I need to compile this to make it fail here)

Actually I got it, reproduced and fixed for the next build.

bugs://72184 got closed with status fixed.

Is it possible to get a build where this is fixed? I am kind of stuck as I can’t complete this class and my app relies on the functionality in this class.

The last beta should fix this

@ck I’m getting the same error:

02-04 12:52:48.767 12459-12459/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: org.me.sampleandroidappfire, PID: 12459
                                                   java.lang.VerifyError: Verifier rejected class org.me.sampleandroidappfire.MainActivity due to bad method void org.me.sampleandroidappfire.MainActivity.onCreate(android.os.Bundle) (declaration of 'org.me.sampleandroidappfire.MainActivity' appears in /data/app/org.me.sampleandroidappfire-2/base.apk)
                                                       at java.lang.Class.newInstance(Native Method)
                                                       at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
                                                       at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:148)
                                                       at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
02-04 12:52:48.772 607-15463/? W/ActivityManager:   Force finishing activity org.me.sampleandroidappfire/.MainActivity 

in the latest Fire beta 8.30.90.1925.

This happens in Fire Android app / Silver (the basic template app).

A related issue could be an Alert in Fire that occasionally shows up and that tells the user that

The process failed to start without an error message being provided by the debug engine.

I have a Nexus7 attached to adb:

macbookproloreto:swift-promise-example admin$ /Users/admin/Library/Android/sdk/platform-tools/adb devices
List of devices attached
0a21584f	device

bugs://72184 got reopened.

Well that doesn’t sound right. I’ll look into it.

1 Like

This seems to be from June, if I got a testcase through another chnnel I must have lost it by now. I just tried this:

import java.util
import android.app
import android.content
import android.os
import android.util
import android.view
import android.widget

public class MainActivity: Activity {

	public override func onCreate(savedInstanceState: Bundle!) {
		super.onCreate(savedInstanceState)
		ContentView = R.layout.main

		var q = Test<String>()
		q.makeUpdateSqls()
	}
}


enum ObjectStatus {
  case Added
  case Modified
  case Removed
}
class Item<T> {
  var Key: T!
  var Value: ObjectStatus!
}
class Test<T> {
    
    func ForEach<TA>(x: (Item<T>) -> ()) {}
  private func makeUpdateSqls() -> Boolean {
  ForEach<(T, ObjectStatus)>({x in 
    self.handleModifiedItem(x.Key, x.Value)
  })

  return true
}
public func addInsertSql(_item: T) {}
public func addUpdateSql(_item: T) {}
public func addDeleteSql(_item: T) {}
  public func handleModifiedItem(_ item: T, _ itemStatus: ObjectStatus) {
  switch itemStatus {
    case ObjectStatus.Added: addInsertSql(item)
    case ObjectStatus.Modified: addUpdateSql(item)
    case ObjectStatus.Removed: addDeleteSql(item)
    default: __throw Exception("Invalid ObjectStatus")
  }
}
}

and that compile fine. Do you have a more complete fragment I can try?

Waiting to check this as soon as I get the latest beta of fire (the project fails to compile in the shared library…)

bugs://72184 got closed with status fixed.