codezri / flutter-gomobile

Using Go modules in Flutter
MIT License
18 stars 3 forks source link

Build error #2

Open ioudkerk opened 1 year ago

ioudkerk commented 1 year ago

Hi, when I try to make the bind I have this problem:

gomobile: javac -d /var/folders/vh/x6hcl1dn6yldgshztnzxrw840000gn/T/gomobile-work-2295035399/javac-output -source 1.7 -target 1.7 -bootclasspath /Users/ivan/Library/Android/sdk/platforms/android-33/android.jar go/Seq.java go/Universe.java go/error.java gomobilelib/Gomobilelib.java failed: exit status 1 warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. gomobilelib/Gomobilelib.java:10: error: class GoMobileLib is public, should be declared in a file named GoMobileLib.java public final class GoMobileLib implements Seq.Proxy { ^ gomobilelib/Gomobilelib.java:11: error: cannot access Gomobilelib static { Gomobilelib.touch(); } ^ bad source file: ./gomobilelib/Gomobilelib.java file does not contain class gomobilelib.Gomobilelib Please remove or make sure it appears in the correct subdirectory of the sourcepath. 2 errors 3 warnings

Android NDK: android-ndk-r19c Hardware: Apple M1 Go Version: go version go1.19.3 darwin/arm64

williamidt commented 1 year ago

Hi friend, I had exactly the same problem. Today I found the solution

I changed the name GoMobilelib to DataProcessor in the gomobilelib.go.. file and it compiled

As I researched here on github, I thought it would be cool to share the solution with the community. If you need it and are interested, just see my code on github

https://github.com/williamidt/flutter_go_mobile

tmj,